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.

Showing 1-7 of 7 results.

A007697 Smallest odd number expressible in at least n ways as p+2*m^2 where p is 1 or a prime and m >= 0.

Original entry on oeis.org

1, 3, 13, 19, 55, 61, 139, 139, 181, 181, 391, 439, 559, 619, 619, 829, 859, 1069, 1081, 1459, 1489, 1609, 1741, 1951, 2029, 2341, 2341, 3331, 3331, 3331, 3961, 4189, 4189, 4261, 4801, 4801, 5911, 5911, 5911, 6319, 6319, 6319, 8251, 8251, 8251, 8251, 8251
Offset: 1

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    import Data.List (findIndex)
    import Data.Maybe (fromJust)
    a007697 n = 2 * (fromJust $ findIndex (>= n) a046921_list) + 1
    -- Reinhard Zumkeller, Apr 03 2013
  • Mathematica
    max = 9000; sp = Outer[Plus, Prepend[Prime /@ Range[PrimePi[max]], 1], 2*Range[0, Ceiling[Sqrt[max/2]]]^2] // Flatten // Sort // Split;
    a[1] = 3; a[n_] := (sel = Select[sp, Length[#] >= n &];
    If[sel == {}, {}, sel[[1, 1]]]); a /@ Range[47]
    (* Jean-François Alcover, Apr 29 2011 *)

Extensions

Stern and Hardy-Littlewood references suggested by Ctibor O. Zizka, Apr 14 2008
Edited by N. J. A. Sloane, May 15 2008 at the suggestion of R. J. Mathar
a(1) changed to 1 at the suggestion of Donovan Johnson by N. J. A. Sloane, May 10 2011

A046923 Number of ways to express 2n+1 as p+2a^2; p prime, a >= 0.

Original entry on oeis.org

0, 1, 2, 2, 1, 2, 3, 2, 1, 3, 3, 2, 3, 1, 2, 4, 1, 2, 4, 3, 2, 3, 3, 2, 4, 2, 2, 5, 1, 2, 6, 3, 1, 3, 4, 2, 4, 4, 2, 6, 3, 2, 4, 2, 3, 6, 2, 1, 4, 2, 4, 6, 4, 2, 6, 5, 2, 6, 3, 2, 5, 1, 2, 3, 4, 4, 5, 4, 1, 8, 4, 1, 6, 3, 2, 6, 2, 2, 6, 6, 1, 3, 5, 3, 7, 4, 3, 6, 2, 3, 10, 2, 3, 4, 4, 3, 3, 4, 2
Offset: 0

Views

Author

Keywords

Comments

The only zero terms appear to be for the odd numbers 1, 5777 and 5993. - T. D. Noe, Aug 23 2008
a(n) = A046922(A005408(n)). - Reinhard Zumkeller, Apr 03 2013

Crossrefs

Programs

Extensions

Definition corrected by T. D. Noe, Aug 23 2008

A046920 Number of ways to express n as p+2a^2; p = 1 or prime, a >= 0.

Original entry on oeis.org

1, 1, 2, 1, 2, 0, 2, 0, 2, 1, 2, 0, 3, 0, 2, 0, 1, 0, 4, 1, 3, 0, 2, 0, 3, 0, 1, 0, 2, 0, 4, 0, 2, 1, 2, 0, 4, 0, 3, 0, 2, 0, 3, 0, 3, 0, 2, 0, 4, 0, 3, 1, 2, 0, 5, 0, 1, 0, 2, 0, 6, 0, 3, 0, 1, 0, 3, 0, 4, 0, 2, 0, 5, 1, 4, 0, 2, 0, 6, 0, 3, 0, 2, 0, 4, 0, 2, 0, 3, 0, 6, 0, 2, 0, 1, 0, 4, 0, 3
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a046920 n = length $ filter ((\x -> x == 1 || a010051 x == 1) . (n -)) $
                                takeWhile (< n) a001105_list
    -- Reinhard Zumkeller, Apr 03 2013

A143539 Number of ways to express 2n-1 as p+2a^2; p prime, a > 0.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 2, 2, 0, 2, 3, 1, 3, 1, 1, 3, 1, 2, 3, 3, 1, 2, 3, 1, 4, 2, 1, 5, 1, 1, 5, 3, 1, 2, 4, 1, 3, 4, 2, 5, 3, 1, 4, 2, 2, 6, 2, 1, 3, 2, 3, 5, 4, 1, 5, 5, 1, 6, 3, 2, 5, 1, 2, 2, 4, 3, 5, 4, 0, 7, 4, 1, 6, 3, 1, 5, 2, 2, 5, 6, 1, 2, 5, 2, 7, 4, 2, 6, 2, 2, 9, 2, 3, 4, 4, 2, 2, 4, 1, 9, 5, 3, 5, 5, 3
Offset: 1

Views

Author

T. D. Noe, Aug 23 2008

Keywords

Comments

Similar to A046921 and A046923. Sequence A060003 lists the odd numbers having no representations.

Examples

			a(11)=3 because 21 = 19+2*1^2 = 13+2*2^2 = 3+2*3^2.
		

Programs

  • Mathematica
    Table[cnt=0; Do[If[PrimeQ[n-2*k^2], cnt++ ], {k,Floor[Sqrt[n/2]]}]; cnt, {n,1,20000,2}]

A046922 Number of ways to express n as p+2a^2; p prime, a >= 0.

Original entry on oeis.org

0, 1, 1, 1, 2, 0, 2, 0, 1, 1, 2, 0, 3, 0, 2, 0, 1, 0, 3, 1, 3, 0, 2, 0, 3, 0, 1, 0, 2, 0, 4, 0, 1, 1, 2, 0, 4, 0, 3, 0, 2, 0, 3, 0, 3, 0, 2, 0, 4, 0, 2, 1, 2, 0, 5, 0, 1, 0, 2, 0, 6, 0, 3, 0, 1, 0, 3, 0, 4, 0, 2, 0, 4, 1, 4, 0, 2, 0, 6, 0, 3, 0, 2, 0, 4, 0, 2, 0, 3, 0, 6, 0, 2, 0, 1, 0, 4, 0, 2
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a046922 n = sum $ map (a010051 . (n -)) $ takeWhile (< n) a001105_list
    -- Reinhard Zumkeller, Apr 03 2013

A228466 Smallest odd number expressible in exactly n ways as p + 2*m^2 where p is 1 or a prime and m >= 0.

Original entry on oeis.org

5777, 1, 3, 13, 19, 55, 61, 169, 139, 271, 181, 391, 439, 559, 661, 619, 829, 859, 1069, 1081, 1459, 1489, 1609, 1741, 1951, 2029, 2509, 2341, 3631, 3769, 3331, 3961, 4525, 4189, 4261, 5281, 4801, 6229, 6361, 5911, 6439, 7111, 6319, 13081, 9931, 8869, 10321
Offset: 0

Views

Author

Donovan Johnson, Aug 22 2013

Keywords

Examples

			a(3) = 13 = 5+2*2^2 = 11+2*1^2 = 13+2*0^2. 13 is the smallest odd number expressible in exactly 3 ways.
a(4) = 19 = 1+2*3^2 = 11+2*2^2 = 17+2*1^2 = 19+2*0^2. 19 is the smallest odd number expressible in exactly 4 ways.
a(5) = 55 = 5+2*5^2 = 23+2*4^2 = 37+2*3^2 = 47+2*2^2 = 53+2*1^2. 55 is the smallest odd number expressible in exactly 5 ways.
		

Crossrefs

Programs

  • Mathematica
    (* finds terms < mx *) upto[mx_] := Block[{r = Floor[1+mx/2], k, t, p, s = {}}, t = 0*Range@r; p = Prime@ Range@ PrimePi@ mx; p[[1]] = 1; t[[# + Range[0, Sqrt[r - #]]^2]]++ & /@ ((1 + p)/2); k = 0; While[(r = Position[t, k, 1, 1]) != {}, k++; AppendTo[s, 2 r[[1,1]] - 1]]; s]; upto[10^5] (* Giovanni Resta, Aug 23 2013 *)
  • PARI
    /* finds terms up to a(1000) */ mx=10602619; v=vector(mx); nn=vector(1000); p=vector(701940); p[1]=1; pr=2; for(j=2, 701940, pr=nextprime(pr+1); p[j]=pr); for(m=0, 2302, m2=2*m^2; for(j=1, 701940, s=m2+p[j]; if(s<=mx, v[s]++, next(2)))); forstep(j=1, mx, 2, if(v[j]==0, write("b228466.txt", 0 " " j); j=mx)); forstep(j=1, mx, 2, if(v[j]>0, if(v[j]<=1000, if(nn[v[j]]==0, nn[v[j]]=j)))); for(n=1, 1000, write("b228466.txt", n " " nn[n]))

A346368 Odd numbers that can be written in a single way as 2*k^2+p, k>0, p prime.

Original entry on oeis.org

5, 7, 9, 11, 23, 27, 29, 33, 41, 47, 53, 57, 59, 65, 71, 83, 95, 107, 113, 123, 143, 149, 161, 197, 233, 239, 257, 281, 287, 317, 323, 347, 383, 407, 413, 443, 449, 569, 743, 773, 785, 863, 1227, 1367, 1415, 1703, 1787, 2123, 2507, 2933, 3317, 3515, 3713, 4673, 5987, 6797
Offset: 1

Views

Author

Bernard Pitie, Jul 14 2021

Keywords

Comments

The next element, if it exists, is greater than 10^8.

Crossrefs

Programs

  • PARI
    isok(m) = (m>3) && (m % 2) && (sum(i=1, sqrtint((m-3)/2), isprime(m-2*i^2)) == 1); \\ Michel Marcus, Jul 22 2021
Showing 1-7 of 7 results.