cp's OEIS Frontend

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.

A256917 Primes which are not the sums of two consecutive nonsquares.

This page as a plain text file.
%I A256917 #37 Mar 06 2024 11:18:23
%S A256917 2,3,7,17,19,31,71,73,97,127,163,199,241,337,449,577,647,881,883,967,
%T A256917 1151,1153,1249,1459,1567,1801,2179,2311,2591,2593,2887,3041,3361,
%U A256917 3527,3529,3697,4049,4051,4231,4801,4999,5407,6271,6961,7687,7937,8191,8713,9521,10369,10657
%N A256917 Primes which are not the sums of two consecutive nonsquares.
%C A256917 The union of 2 and A066436 and A090698.
%C A256917 The sums of two consecutive nonsquares are 5, 8, 11, 13, 15, 18, 21, 23, 25, 27, 29, 32, 35, 37, ...
%H A256917 Colin Barker and Charles R Greathouse IV, <a href="/A256917/b256917.txt">Table of n, a(n) for n = 1..10000</a> (first 800 terms from Barker)
%e A256917 2, 3, 7 are in this sequence because first three sums of two consecutive nonsquares are 5, 8, 11 and 2, 3, 7 are primes.
%t A256917 Union[{2},Select[Table[2n^2-1,{n,0,1000}],PrimeQ],Select[Table[2n^2+1,{n,0,1000}],PrimeQ]] (* _Ivan N. Ianakiev_, Apr 24 2015 *)
%t A256917 Module[{nn=11000,ns},ns=Total/@Partition[Select[Range[nn],!IntegerQ[Sqrt[#]]&],2,1]; Complement[ Prime[Range[PrimePi[Last[ns]]]],ns]] (* _Harvey P. Dale_, Mar 06 2024 *)
%o A256917 (PARI)
%o A256917 a256917(maxp) = {
%o A256917   ps=[2];
%o A256917   k=1; while((t=2*k^2-1)<=maxp, k++; if(isprime(t), ps=setunion(ps, [t])));
%o A256917   k=1; while((t=2*k^2+1)<=maxp, k++; if(isprime(t), ps=setunion(ps, [t])));
%o A256917   ps
%o A256917 }
%o A256917 a256917(11000) \\ _Colin Barker_, Apr 23 2015
%o A256917 (PARI) list(lim)=my(v=List([2]),t); for(k=2,sqrtint((lim+1)\2), if(isprime(t=2*k^2-1), listput(v,t))); for(k=1,sqrtint((lim-1)\2), if(isprime(t=2*k^2+1), listput(v,t))); Set(v) \\ _Charles R Greathouse IV_, Apr 23 2015
%Y A256917 Cf. A000037, A066436, A090698, A154670.
%K A256917 nonn,easy
%O A256917 1,1
%A A256917 _Juri-Stepan Gerasimov_, Apr 23 2015