This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A228446 #49 Dec 17 2024 13:06:04 %S A228446 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, %T A228446 7,23,11,13,29,17,3,5,7,61,11,13,31,17,19,3,5,7,43,11,13,103,17,19, %U A228446 109,3,5,7,29,11,13,53,17,19,41,23,3,5,7,31,11,13,37 %N 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. %C A228446 Based on Sun's conjecture 1.4 in the paper referenced below. %C A228446 The plot shows an ever-widening band of sawtooth shape. New maxima values will include sequence members larger than the largest prime factor of the original n. For example when n = 21 with prime factors 3 and 7, and a(10) = 19. %C A228446 a(A000124(n)) = 3; a(A133263(n)) = 5; a(A167614(n)) = 7. - _Reinhard Zumkeller_, Mar 12 2014 %D A228446 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.) %H A228446 T. D. Noe, <a href="/A228446/b228446.txt">Table of n, a(n) for n = 2..1000</a> %H A228446 Z. W. Sun, <a href="http://arxiv.org/abs/0803.3737">On sums of primes and triangular numbers</a>, arXiv:0803.3737 [math.NT], 2008-2009. %H A228446 Christian Krause, et al, <a href="https://github.com/loda-lang/loda-programs/blob/main/oeis/228/A228446.asm">A mined LODA assembly source for this sequence</a> (conjectured) %e A228446 21 = 19+1*2 where no solution exists using p = 2, 3, 5, 7, 11, 13, 17. So a(10) = 19. %e A228446 51 = 31+4*5 where no lower odd prime provides a solution. So a(25) = 31. %t A228446 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 *) %o A228446 (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 %o A228446 (Haskell) %o A228446 a228446 n = head %o A228446 [q | let m = 2 * n + 1, %o A228446 q <- map (m -) $ reverse $ takeWhile (< m) $ tail a002378_list, %o A228446 a010051 q == 1] %o A228446 -- _Reinhard Zumkeller_, Mar 12 2014 %Y A228446 Cf. A010051, A002378, A000217. %K A228446 easy,nonn %O A228446 2,1 %A A228446 _Bill McEachen_, Oct 26 2013 %E A228446 Entry revised by _N. J. A. Sloane_, Nov 11 2020 (including addition of escape clause).