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-4 of 4 results.

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)

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

A299646 a(n) = Sum_{k = n..2*n+1} k^2.

Original entry on oeis.org

1, 14, 54, 135, 271, 476, 764, 1149, 1645, 2266, 3026, 3939, 5019, 6280, 7736, 9401, 11289, 13414, 15790, 18431, 21351, 24564, 28084, 31925, 36101, 40626, 45514, 50779, 56435, 62496, 68976, 75889, 83249, 91070, 99366, 108151, 117439, 127244, 137580, 148461, 159901
Offset: 0

Views

Author

Bruno Berselli, Feb 20 2018

Keywords

Comments

Inverse binomial transform is 1, 13, 27, 14, 0, 0, 0, ... (0 continued).

Crossrefs

Subsequence of A008854, A047388, A174070 (after 1).
Cf. A050409: Sum_{k = n..2*n} k^2; A050410: Sum_{k = n..2*n-1} k^2.

Programs

  • GAP
    List([0..50], n -> (n+2)*(14*n^2+11*n+3)/6);
    
  • Magma
    [(n+2)*(14*n^2+11*n+3)/6: n in [0..50]];
    
  • Maple
    seq((n + 2)*(14*n^2 + 11*n + 3)/6, n=0..50); # Peter Luschny, Feb 21 2018
  • Mathematica
    Table[(n + 2) (14 n^2 + 11 n + 3)/6, {n, 0, 50}]
    (* Second program: *)
    LinearRecurrence[{4, -6, 4, -1}, {1, 14, 54, 135}, 41] (* Jean-François Alcover, Feb 21 2018 *)
  • Maxima
    makelist((n+2)*(14*n^2+11*n+3)/6, n, 0, 50);
    
  • PARI
    a(n)=(n+2)*(14*n^2+11*n+3)/6 \\ Charles R Greathouse IV, Feb 21 2018
    
  • PARI
    Vec((1 + 10*x + 4*x^2 - x^3)/(1 - x)^4 + O(x^60)) \\ Colin Barker, Feb 22 2018
  • Sage
    [(n+2)*(14*n^2+11*n+3)/6 for n in (0..50)]
    

Formula

O.g.f.: (1 + 10*x + 4*x^2 - x^3)/(1 - x)^4.
E.g.f.: (6 + 78*x + 81*x^2 + 14*x^3)*exp(x)/6.
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4).
a(n) = (n + 2)*(14*n^2 + 11*n + 3)/6. Therefore:
a(6*k + r) = 504*k^3 + 18*(14*r + 13)*k^2 + (42*r^2 + 78*r + 25)*k + a(r), with 0 <= r <= 5. Example: for r=5, a(6*k + 5) = (6*k + 7)*(84*k^2 + 151*k + 68).
Showing 1-4 of 4 results.