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-10 of 12 results. Next

A174090 Powers of 2 and odd primes; alternatively, numbers that cannot be written as a sum of at least three consecutive positive integers.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 11, 13, 16, 17, 19, 23, 29, 31, 32, 37, 41, 43, 47, 53, 59, 61, 64, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 128, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 256
Offset: 1

Views

Author

Vladimir Joseph Stephan Orlovsky, Mar 07 2010, and Omar E. Pol, Feb 24 2014

Keywords

Comments

From Omar E. Pol, Feb 24 2014: (Start)
Also the odd noncomposite numbers (A006005) and the powers of 2 with positive exponent, in increasing order.
If a(n) is composite and a(n) - a(n-1) = 1 then a(n-1) is a Mersenne prime (A000668), hence a(n-1)*a(n)/2 is a perfect number (A000396) and a(n-1)*a(n) equals the sum of divisors of a(n-1)*a(n)/2.
If a(n) is even and a(n+1) - a(n) = 1 then a(n+1) is a Fermat prime (A019434). (End)

Crossrefs

Numbers not in A111774.
Equals A000079 UNION A065091.
Equals A067133 \ {6}.

Programs

  • Maple
    N:= 300: # to get all terms <= N
    S:= {seq(2^i,i=0..ilog2(N))} union select(isprime,{ 2*i+1 $ i=1..floor((N-1)/2) }):
    sort(convert(S,list)); # Robert Israel, Jun 18 2015
  • Mathematica
    a[n_] := Product[GCD[2 i - 1, n], {i, 1, (n - 1)/2}] - 1;
    Select[Range[242], a[#] == 0 &] (* Gerry Martens, Jun 15 2015 *)
  • PARI
    list(lim)=Set(concat(concat(1,primes(lim)), vector(logint(lim\2,2),i,2^(i+1)))) \\ Charles R Greathouse IV, Sep 19 2024
    
  • PARI
    select( {is_A174090(n)=isprime(n)||n==1<M. F. Hasler, Oct 24 2024
  • Python
    from sympy import primepi
    def A174090(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(n+x+(0 if x<=1 else 1-primepi(x))-x.bit_length())
        return bisection(f,n,n) # Chai Wah Wu, Sep 19 2024
    

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Sep 19 2024

Extensions

This entry is the result of merging an old incorrect entry and a more recent correct version. N. J. A. Sloane, Dec 07 2015

A027578 Sums of five consecutive squares: a(n) = n^2 + (n+1)^2 + (n+2)^2 + (n+3)^2 + (n+4)^2.

Original entry on oeis.org

30, 55, 90, 135, 190, 255, 330, 415, 510, 615, 730, 855, 990, 1135, 1290, 1455, 1630, 1815, 2010, 2215, 2430, 2655, 2890, 3135, 3390, 3655, 3930, 4215, 4510, 4815, 5130, 5455, 5790, 6135, 6490, 6855, 7230, 7615, 8010, 8415, 8830, 9255, 9690, 10135, 10590, 11055
Offset: 0

Views

Author

Keywords

Comments

a(n) is defined for n < 0 and a(-n) = a(n-4) for any n; a(-3) = a(-1) = 15, a(-2) = 10. - Jean-Christophe Hervé, Nov 11 2015

Crossrefs

Programs

  • Magma
    [n^2+(n+1)^2+(n+2)^2+(n+3)^2+(n+4)^2: n in [0..50] ]; // Vincenzo Librandi, Jun 17 2011
    
  • Maple
    A027578:=n->5*(n+2)^2+10: seq(A027578(n), n=0..50); # Wesley Ivan Hurt, Nov 12 2015
  • Mathematica
    Table[5 (n + 2)^2 + 10, {n, 0, 50}] (* Bruno Berselli, Jul 29 2015 *)
    Total/@Partition[Range[0,50]^2,5,1] (* or *) LinearRecurrence[{3,-3,1},{30,55,90},50] (* Harvey P. Dale, Mar 06 2018 *)
  • PARI
    vector(100, n, n--; n^2+(n+1)^2+(n+2)^2+(n+3)^2+(n+4)^2) \\ Altug Alkan, Nov 11 2015
  • Sage
    [i^2+(i+1)^2+(i+2)^2+(i+3)^2+(i+4)^2 for i in range(0,50)] # Zerinvary Lajos, Jul 03 2008
    

Formula

a(n) = 5*A059100(n+2).
From Colin Barker, Mar 29 2012: (Start)
G.f.: 5*(6-7*x+3*x^2)/(1-x)^3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n>2. (End)
a(n) = 5*(n + 2)^2 + 10. a(n) is never square. - Bruno Berselli, Jul 29 2015
E.g.f.: 5*(6 + 5*x + x^2)*exp(x). - G. C. Greubel, Aug 24 2022
From Amiram Eldar, Sep 15 2022: (Start)
Sum_{n>=0} 1/a(n) = coth(sqrt(2)*Pi)*Pi/(10*sqrt(2)) - 7/60.
Sum_{n>=0} (-1)^n/a(n) = cosech(sqrt(2)*Pi)*Pi/(10*sqrt(2)) + 1/60. (End)

A151557 Squares which are the sum of two or more consecutive squares.

Original entry on oeis.org

25, 841, 4900, 5929, 8464, 11236, 19044, 20449, 24964, 28561, 33124, 38025, 60025, 64009, 75076, 127449, 148225, 170569, 184900, 193600, 245025, 281961, 422500, 425104, 429025, 461041, 524176, 620944, 632025, 970225, 1024144, 1044484, 1113025, 1283689
Offset: 1

Views

Author

N. J. A. Sloane, May 21 2009

Keywords

Examples

			25 = 5^2 = 3^2 + 4^2
841 = 29^2 = 20^2 + 21^2
4900 is the sum of the first 24 squares.
		

Crossrefs

Cf. A001032. Superset is A174069.

Programs

Formula

a(n) = A097812(n)^2.

A062681 Numbers that are sums of 2 or more consecutive squares in more than 1 way.

Original entry on oeis.org

365, 1405, 1730, 2030, 3281, 3655, 3740, 4510, 4705, 4760, 5244, 5434, 5915, 7230, 7574, 8415, 9385, 11055, 11900, 12325, 12524, 14905, 16745, 17484, 18879, 19005, 19855, 20449, 20510, 21790, 22806, 23681, 25580, 25585, 27230, 27420, 28985
Offset: 1

Views

Author

Erich Friedman, Jul 04 2001

Keywords

Comments

A subsequence of A174069; A111044 is the subsequence of numbers allowing at least 3 representations of the given form. - M. F. Hasler, Dec 23 2013

Examples

			365 = 10^2 + 11^2 + 12^2 = 13^2 + 14^2.
		

Crossrefs

Programs

A111044 Integers which can be written as a sum of at least 2 consecutive squares in at least 3 different ways.

Original entry on oeis.org

147441, 910805, 1026745, 2403800, 2513434, 3198550, 11739805, 15053585, 18646301, 33313175, 93812510, 102939515, 134910295, 136448235, 151443110, 163998695, 195435485, 197780465, 213872920, 267043455, 461498779, 482204660, 554503705, 559990541, 601704095
Offset: 1

Views

Author

Sébastien Dumortier, Oct 06 2005

Keywords

Comments

The smallest number which can be expressed in 4 such ways is 554503705, which is equal to the sum of squares of the integers in the closed intervals (480,1210), (3570,3612), (3613,3654) and (7442,7451). - Giovanni Resta, Jul 25 2007

Examples

			147441 = 85^2 + 86^2 + ... + 101^2 = 29^2 + 30^2 + ... + 77^2 = 18^2 + 19^2 + ... + 76^2;
910805 = 550^2 + 551^2 + 552^2 = 144^2 + 145^2 + ... + 178^2 = 35^2 + 36^2 + ... + 140^2;
1026745 = 716^2 + 717^2 = 51^2 + 52^2 + ... + 147^2 = 1^2 + 2^2 + ... + 145^2;
2403800 = 583^2 + 584^2 + ... + 589^2 = 368^2 + 369^2 + ... + 384^2 = 298^2 + 299^2 + ... + 322^2;
2513434 = 473^2 + 474^2 + ... + 483^2 = 286^2 + 287^2 + ... + 313^2 = 66^2 + 67^2 + ... + 198^2;
3198550 = 225^2 + 226^2 + ... + 275^2 = 127^2 + 128^2 + ... + 226^2 = 1^2 + 2^2 + ... + 212^2.
		

Crossrefs

Extensions

More terms from Giovanni Resta, Jul 25 2007

A163251 Primes that are sum of (at least two) consecutive squares.

Original entry on oeis.org

5, 13, 29, 41, 61, 113, 139, 149, 181, 199, 271, 313, 421, 509, 613, 677, 761, 811, 1013, 1201, 1279, 1301, 1459, 1741, 1861, 1877, 2113, 2381, 2521, 2539, 2791, 3121, 3331, 3613, 3677, 3919, 4231, 4513, 5101, 7159, 7321, 8011, 8429, 8581, 9661, 9749, 9859
Offset: 1

Views

Author

Gaurav Kumar, Jul 23 2009

Keywords

Comments

Let S(n,k) = (n+1)^2 + (n+2)^2 +... + (n+k)^2, n>=0, k>=2. S(n,k) is always composite for k=4 (2 | S), k=5 (5 | S), and k >= 7 (see A256503). So a(n) is the sum of 2, 3, or 6 consecutive squares. The smallest a(n) that cannot be written as a sum of fewer than 6 consecutive squares is a(7)=139. - Vladimir Shevelev, Apr 08 2015

Examples

			5 = 1^2 + 2^2.
13 = 2^2 + 3^2.
29 = 2^2 + 3^2 + 4^2.
		

Crossrefs

A027862 is a subsequence.
Subsequence of A174069.

Programs

  • Mathematica
    lst = {}; Do[p = m^2; Do[p += n^2; If[PrimeQ[p] && p <= 101701, AppendTo[lst, p]], {n, m + 1, 6!, 1}], {m, 6!}]; Take[Union@lst, 5!] (* Vladimir Joseph Stephan Orlovsky, Sep 15 2009 *)
    Select[Union[Flatten[Table[Total/@Partition[Range[100]^2,n,1],{n,2,10}]]],PrimeQ] (* Harvey P. Dale, Mar 12 2015 *)

Extensions

Offset corrected by Donovan Johnson, Nov 05 2012

A174070 Numbers that can be written as a sum of at least 3 consecutive squares.

Original entry on oeis.org

14, 29, 30, 50, 54, 55, 77, 86, 90, 91, 110, 126, 135, 139, 140, 149, 174, 190, 194, 199, 203, 204, 230, 245, 255, 271, 280, 284, 285, 294, 302, 330, 355, 365, 366, 371, 380, 384, 385, 415, 434, 446, 451, 476, 492, 501, 505, 506, 509, 510, 534, 559, 590, 595
Offset: 1

Views

Author

Keywords

Comments

Numbers of the form (a(a+1)(2a+1)-b(b+1)(2b+1))/6 where a >= b+3 and b >= 0. - Robert Israel, Jul 18 2017

Examples

			14 = 1^2 + 2^2 + 3^2, 29 = 2^2 + 3^2 + 4^2.
30 = 1^2 + 2^2 + 3^2 + 4^2, 50 = 3^2 + 4^2 + 5^2.
		

Crossrefs

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    R:= [seq(b*(b+1)*(2*b+1)/6, b=0..ceil(sqrt(N/3)))]:
    sort(convert(select(`<=`, {seq(seq(R[i]-R[j],j=1..i-3),i=1..nops(R))},N),list)); # Robert Israel, Jul 18 2017
  • Mathematica
    max=50^2;lst={};Do[z=n^2+(n+1)^2;Do[z+=(n+x)^2;If[z>max,Break[]];AppendTo[lst,z],{x,2,max/2}],{n,max/2}];Union[lst]
    (* Second program: *)
    Function[s, Function[t, Union@ Flatten@ Map[TakeWhile[#, # < t[[1, -1]] &] &, t]]@ Map[Total /@ Partition[s, #, 1] &, Range[3, Length@ s]]][Range[16]^2] (* Michael De Vlieger, Jul 18 2017 *)
    Module[{nn=30,sq},sq=Range[nn]^2;Take[Union[Flatten[Table[Total/@ Partition[ sq,n,1],{n,3,nn-2}]]],2nn]] (* Harvey P. Dale, Nov 16 2017 *)

A212016 Sums of the squares of two or more consecutive integers.

Original entry on oeis.org

1, 2, 5, 6, 10, 13, 14, 15, 19, 25, 28, 29, 30, 31, 35, 41, 44, 50, 54, 55, 56, 60, 61, 69, 77, 85, 86, 90, 91, 92, 96, 105, 110, 113, 121, 126, 135, 139, 140, 141, 145, 146, 149, 154, 170, 174, 181, 182, 190, 194, 195, 199, 203, 204, 205, 209, 218
Offset: 1

Views

Author

Max Alekseyev, Apr 26 2012

Keywords

Comments

Subsequence of A062861.
Contains A212015 as a subsequence.
A174069 is a subsequence. - Altug Alkan, Dec 24 2015

Crossrefs

Programs

  • Maple
    N:= 1000: # to get all terms <=N
    g:= x -> x*(x+1)*(2*x+1)/6:
    S:= select(`<=`,{seq(seq(g(b)-g(a), a= -b-1 .. b-2), b = 1..floor((sqrt(2*N-1)+1)/2))},N):
    sort(convert(S,list)); # Robert Israel, Jan 05 2016
  • PARI
    { isA212016(t) = fordiv(6*t,k, if(k==1,next); z=(k^2-1)/3; if(issquare(4*t/k-z), return(k)); if(z>4*t/k,break); ); 0 }

A174071 Numbers that can be written as a sum of at least 4 consecutive positive squares.

Original entry on oeis.org

30, 54, 55, 86, 90, 91, 126, 135, 139, 140, 174, 190, 199, 203, 204, 230, 255, 271, 280, 284, 285, 294, 330, 355, 366, 371, 380, 384, 385, 415, 446, 451, 476, 492, 501, 505, 506, 510, 534, 559, 595, 615, 620, 630, 636, 645, 649, 650, 679, 728, 730, 734, 764
Offset: 1

Views

Author

Keywords

Comments

Numbers of the form m*(6*k^2 + 6*k*m + 2*m^2 - 6*k - 3*m + 1)/6 for some m>=4 and k>=1. - Robert Israel, May 06 2019

Examples

			30=1^2+2^2+3^2+4^2, 54=2^2+3^2+4^2+5^2, 55=1^2+2^2+3^2+4^2+5^2, ...
		

Crossrefs

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    Res:= NULL:
    for m from 4 while m*(m+1)*(2*m+1)/6 <= N do
       for k from 1 do
           v:= m*(6*k^2 + 6*k*m + 2*m^2 - 6*k - 3*m + 1)/6;
           if v > N then break fi;
           Res:= Res, v;
    od od:
    sort(convert({Res},list));  Robert Israel, May 06 2019
  • Mathematica
    max=60^2;lst={};Do[z=n^2+(n+1)^2+(n+2)^2;Do[z+=(n+x)^2;If[z>max,Break[]];AppendTo[lst,z],{x,3,Sqrt[max]/2}],{n,Sqrt[max]/2}];Union[lst]

Extensions

Edited by Robert Israel, May 06 2019

A234311 Least number which can be written as a sum of at least 2 consecutive squares in at least n different ways.

Original entry on oeis.org

5, 365, 147441, 554503705
Offset: 1

Views

Author

M. F. Hasler, Dec 23 2013

Keywords

Comments

No more terms < 10^18. [Lars Blomberg, Jun 02 2014]

Examples

			a(1) = 5 = 1^2 + 2^2.
a(2) = 365 = 10^2 + 11^2 + 12^2 = 13^2 + 14^2.
a(3) = 147441 = 85^2+...+101^2 = 29^2+...+77^2 = 18^2+...+76^2.
a(4) = 554503705 = 480^2+...+1210^2 = 3570^2+...+3612^2 = 3613^2+...+3654^2 = 7442^2+...+7451^2.
		

Crossrefs

Showing 1-10 of 12 results. Next