-
Notifications
You must be signed in to change notification settings - Fork 0
/
upper-bounds.pl
63 lines (50 loc) · 1.37 KB
/
upper-bounds.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/perl
# a(n) is the least number of the form p^2 + q^2 - 2 for primes p and q that is an odd prime times 2^n, or -1 if there is no such number
# https://oeis.org/A359492
# Known terms:
# 11, 6, -1, 56, 48, 96, 192, 384, 2816, 1536, 109568, 10582016, 12288, 7429922816, 64176128, 4318724096, 196608, 60486975488, 9388028592128
# Observation:
# most solutions have the form 3^2 + q^2.
use 5.020;
use warnings;
use ntheory qw(:all);
my %seen;
my $p = 3;
#my $p = 13;
forprimes {
my $t = subint(addint(mulint($_, $_), $p*$p), 2);
my $v = valuation($t, 2);
my $r = $t >> $v;
if (not exists $seen{$v} and is_prime($r)) {
say "a($v) <= $t";
$seen{$v} = 1;
}
} 1e10;
__END__
a(0) <= 11
a(3) <= 56
a(4) <= 176
a(5) <= 1376
a(6) <= 1856
a(8) <= 2816
a(7) <= 19328
a(10) <= 109568
a(9) <= 344576
a(11) <= 10582016
a(14) <= 64176128
a(12) <= 932630528
a(15) <= 4318724096
a(13) <= 7429922816
a(16) <= 32415481856
a(17) <= 60486975488
a(18) <= 9388028592128
a(20) <= 214058289594368
a(19) <= 849566088298496
a(21) <= 896029329195008
a(22) <= 10228945815339008
a(24) <= 54409680373415936
a(23) <= 188039754665689088
a(25) <= 246561971023904768
a(26) <= 966464636658384896
a(30) <= 1278798840983453696
a(22) <= 10228945815339008; a(23) <= 188039754665689088; a(24) <= 54409680373415936; a(25) <= 246561971023904768; a(26) <= 966464636658384896. - ~~~~