A228446 a(n) = smallest prime p such that 2*n+1 = p + x*(x+1) for some positive integer x, or -1 if no such prime exists.
3, 5, 3, 5, 7, 3, 5, 7, 19, 3, 5, 7, 17, 11, 3, 5, 7, 19, 11, 13, 3, 5, 7, 31, 11, 13, 37, 3, 5, 7, 23, 11, 13, 29, 17, 3, 5, 7, 61, 11, 13, 31, 17, 19, 3, 5, 7, 43, 11, 13, 103, 17, 19, 109, 3, 5, 7, 29, 11, 13, 53, 17, 19, 41, 23, 3, 5, 7, 31, 11, 13, 37
Offset: 2
Examples
21 = 19+1*2 where no solution exists using p = 2, 3, 5, 7, 11, 13, 17. So a(10) = 19. 51 = 31+4*5 where no lower odd prime provides a solution. So a(25) = 31.
References
- Z. W. Sun, On sums of primes and triangular numbers, Journal of Combinatorics and Number Theory 1(2009), no. 1, 65-76. (See Conjecture 1.4.)
Links
- T. D. Noe, Table of n, a(n) for n = 2..1000
- Z. W. Sun, On sums of primes and triangular numbers, arXiv:0803.3737 [math.NT], 2008-2009.
- Christian Krause, et al, A mined LODA assembly source for this sequence (conjectured)
Programs
-
Haskell
a228446 n = head [q | let m = 2 * n + 1, q <- map (m -) $ reverse $ takeWhile (< m) $ tail a002378_list, a010051 q == 1] -- Reinhard Zumkeller, Mar 12 2014
-
Mathematica
nn = 14; ob = Table[n*(n+1), {n, nn}]; Table[p = Min[Select[n - ob, # > 0 && PrimeQ[#] &]]; p, {n, 5, ob[[-1]], 2}] (* T. D. Noe, Oct 27 2013 *)
-
PARI
a(n) = {oddn = 2*n+1; x = oddn; while (! isprime(oddn - x*(x+1)), x--); oddn - x*(x+1);} \\ Michel Marcus, Oct 27 2013
Extensions
Entry revised by N. J. A. Sloane, Nov 11 2020 (including addition of escape clause).
Comments