login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A270649
Greatest m such that 2^m divides p^2 - q^2, where p = prime(n) and q is a prime < p.
2
0, 4, 3, 5, 5, 4, 6, 5, 6, 5, 6, 7, 6, 7, 7, 7, 7, 8, 7, 6, 6, 7, 6, 8, 7, 7, 7, 8, 7, 6, 8, 7, 8, 9, 8, 8, 7, 9, 9, 7, 8, 7, 8, 9, 8, 8, 7, 9, 8, 9, 9, 8, 9, 8, 9, 9, 10, 8, 8, 10, 9, 8, 8, 10, 9, 10, 8, 8, 10, 9, 9, 8, 10, 8, 9, 9, 8, 9, 10, 9, 9, 9, 10
OFFSET
2,2
LINKS
EXAMPLE
For n = 5, the numbers p^2 - q^2 are 121 - 9 = 16*7, 121 - 25 = 32*3, 121 - 49 = 8*7, so that a(5) = 5.
MATHEMATICA
a[n_] := Max[Table[IntegerExponent[Prime[n]^2 - Prime[m]^2, 2], {m, 1, n - 1}]];
u = Table[a[n], {n, 2, 230}]
PROG
(PARI) a(n, p=prime(n))=if(p<5, return(0)); my(p2=p^2); forstep(k=logint(p2-9, 2), 1, -1, my(m=2^k, t); forstep(q=p2-m, 9, -m, if(issquare(q, &t) && isprime(t), return(k)))) \\ Charles R Greathouse IV, Apr 29 2016
CROSSREFS
Sequence in context: A024688 A024477 A368595 * A049008 A280023 A170816
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Apr 26 2016
STATUS
approved