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.

A097602 a(n+1) = a(n) + number of squares so far; a(1) = 1.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 19, 22, 25, 29, 33, 37, 41, 45, 49, 54, 59, 64, 70, 76, 82, 88, 94, 100, 107, 114, 121, 129, 137, 145, 153, 161, 169, 178, 187, 196, 206, 216, 226, 236, 246, 256, 267, 278, 289, 301, 313, 325, 337, 349, 361, 374, 387, 400, 414, 428
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 30 2004

Keywords

Comments

Conjecture: a(n) = m^2 iff m mod 3 > 0.
a(n) is a square iff n is congruent to {1, 4} mod 9. - Vladeta Jovovic, Aug 30 2004

Examples

			a(2) = a(1) + #{1} = 1 + 1 = 2;
a(3) = a(2) + #{1} = 2 + 1 = 3;
a(4) = a(3) + #{1} = 3 + 1 = 4;
a(5) = a(4) + #{1,4} = 4 + 2 = 6;
a(6) = a(5) + #{1,4} = 6 + 2 = 8;
a(7) = a(6) + #{1,4} = 8 + 2 = 10;
a(8) = a(7) + #{1,4} = 10 + 2 = 12;
a(9) = a(8) + #{1,4} = 12 + 2 = 14;
a(10) = a(9) + #{1,4} = 14 + 2 = 16;
a(11) = a(10) + #{1,4,16} = 16 + 3 = 19;
a(12) = a(11) + #{1,4,16} = 19 + 3 = 22.
		

Crossrefs

Programs

  • GAP
    a:=[1,2,3,4,6,8,10,12,14,16,19];; for n in [12..70] do a[n]:= 2*a[n-1]-a[n-2]+a[n-9]-2*a[n-10]+a[n-11]; od; a; # G. C. Greubel, Jan 14 2019
  • Haskell
    a097602 n = a097602_list !! (n-1)
    a097602_list = 1 : f 1 1 where
       f x c = y : f y (c + a010052 y) where y = x + c
    -- Reinhard Zumkeller, Nov 15 2011
    
  • Magma
    m:=70; R:=PowerSeriesRing(Integers(), m); Coefficients(R!( x*(1+x^4-x^9+x^10)/((1+x+x^2)*(1+x^3+x^6)*(1-x)^3) )); // G. C. Greubel, Jan 14 2019
    
  • Mathematica
    LinearRecurrence[{2,-1,0,0,0,0,0,0,1,-2,1}, {1,2,3,4,6,8,10,12,14,16,19}, 70] (* G. C. Greubel, Jan 14 2019 *)
  • PARI
    my(x='x+O('x^70)); Vec(x*(1+x^4-x^9+x^10)/((1+x+x^2)*(1+x^3+x^6)*(1-x)^3)) \\ G. C. Greubel, Jan 14 2019
    
  • Sage
    a=(x*(1+x^4-x^9+x^10)/((1+x+x^2)*(1+x^3+x^6)*(1-x)^3)).series(x, 70).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Jan 14 2019
    

Formula

a(9*n+1) = (3*n+1)^2; a(9*n+4) = (3*n+2)^2. - Vladeta Jovovic, Aug 30 2004
G.f.: x*(1+x^4-x^9+x^10)/((1+x+x^2)*(1+x^3+x^6)*(1-x)^3). - Vladeta Jovovic, Aug 30 2004
a(n+1) = a(n) + Sum_{k=1..n} A010052(a(k)). - Reinhard Zumkeller, Nov 15 2011

A131093 a(1)=1, a(n) = a(n-1) + sum of odd numbers which are among the first (n-1) terms of the sequence.

Original entry on oeis.org

1, 2, 3, 7, 18, 29, 69, 178, 287, 683, 1762, 2841, 6761, 17442, 28123, 66927, 172658, 278389, 662509, 1709138, 2755767, 6558163, 16918722, 27279281, 64919121, 167478082, 270037043, 642633047, 1657862098, 2673091149
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 14 2007

Keywords

Comments

a(n) mod 2 = A011655(n+1);
a(n) = a(n-1) + Sum(a(k)*(a(k) mod 2): 1<=k

Crossrefs

Programs

  • Mathematica
    nxt[{ot_,a_}]:=Module[{x=a+ot},{If[OddQ[x],ot+x,ot],x}]; NestList[nxt,{1,1},30][[All,2]] (* Harvey P. Dale, Dec 18 2020 *)

Formula

Empirical g.f.: -x*(x-1)*(x^4+3*x^3+6*x^2+3*x+1) / (x^6-10*x^3+1). - Colin Barker, Mar 29 2013

A100963 a(1)=1. a(n) = a(n-1) + sum of the triangular numbers which are among the first (n-1) terms of the sequence.

Original entry on oeis.org

1, 2, 3, 7, 11, 15, 34, 53, 72, 91, 201, 311, 421, 531, 641, 751, 861, 1832, 2803, 3774, 4745, 5716, 6687, 7658, 8629, 9600, 10571, 11542, 12513, 13484, 14455, 15426, 16397, 17368, 18339, 19310, 20281, 21252, 22223, 23194, 24165, 25136, 26107, 27078, 28049
Offset: 1

Author

Leroy Quet, Jun 07 2007

Keywords

Crossrefs

Programs

  • Mathematica
    Nest[Append[#, Last@ # + Total@ Select[#, IntegerQ@ First@ Values@ Last@ Solve[x (x + 1)/2 == #, x] &]] &, {1}, 44] (* Michael De Vlieger, Sep 24 2017 *)
  • PARI
    vector(100, n, if(n==1, a_n_1=sum_=1, a_n_1+=sum_; if(ispolygonal(a_n_1, 3), sum_+=a_n_1)); a_n_1) \\ Colin Barker, Feb 19 2015

Extensions

More terms from Robert Gerbicz, Jun 10 2007

A255260 a(n) = a(n-1) + sum of the pentagonal numbers which are among the first (n-1) terms of the sequence, with a(1)=1.

Original entry on oeis.org

1, 2, 3, 4, 5, 11, 17, 23, 29, 35, 76, 117, 275, 433, 591, 749, 907, 1065, 1223, 1381, 1539, 1697, 1855, 2013, 2171, 2329, 2487, 2645, 2803, 2961, 3119, 3277, 3435, 3593, 3751, 3909, 4067, 4225, 4383, 4541, 4699, 4857, 5015, 5173, 5331, 5489, 5647, 5805
Offset: 1

Author

Colin Barker, Feb 19 2015

Keywords

Examples

			a(7) = 17 because a(6) = 11, pentagonal numbers already in the sequence are 1 and 5, and 11+1+5 = 17.
		

Crossrefs

Programs

  • PARI
    vector(100, n, if(n==1, a_n_1=sum_=1, a_n_1+=sum_; if(ispolygonal(a_n_1, 5), sum_+=a_n_1)); a_n_1)

A255261 a(n) = a(n-1) + sum of the hexagonal numbers which are among the first (n-1) terms of the sequence, with a(1)=1.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 13, 20, 27, 34, 41, 48, 55, 62, 69, 76, 83, 90, 97, 104, 111, 118, 125, 132, 139, 146, 153, 313, 473, 633, 793, 953, 1113, 1273, 1433, 1593, 1753, 1913, 2073, 2233, 2393, 2553, 2713, 2873, 3033, 3193, 3353, 3513, 3673, 3833, 3993, 4153
Offset: 1

Author

Colin Barker, Feb 20 2015

Keywords

Examples

			a(8) = 20 because a(7) = 13, hexagonal numbers already in the sequence are 1 and 6, and 13+1+6 = 20.
		

Crossrefs

Programs

  • PARI
    vector(100, n, if(n==1, a_n_1=sum_=1, a_n_1+=sum_; if(ispolygonal(a_n_1, 6), sum_+=a_n_1)); a_n_1)

A381149 a(1) = 2, a(2) = 3; thereafter, a(n) = a(n-1) + sum of prior prime terms.

Original entry on oeis.org

2, 3, 8, 13, 31, 80, 129, 178, 227, 503, 1282, 2061, 2840, 3619, 4398, 5177, 5956, 6735, 7514, 8293, 17365, 26437, 61946, 97455, 132964, 168473, 203982, 239491, 275000, 310509, 346018, 381527, 798563, 1215599, 1632635, 2049671, 2466707, 5350450, 8234193, 11117936
Offset: 1

Author

James C. McMahon, Feb 15 2025

Keywords

Examples

			For n=5, a(5) = a(4) + sum of prior primes = 13 + (2 + 3 + 13) = 31, so that 13 is counted twice.
		

Crossrefs

Programs

  • Mathematica
    Nest[Append[#,#[[-1]]+Total[Select[#,PrimeQ]]]&,{2,3},38]
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        yield from [2, 3]
        primesum, an = 5, 3
        while True:
            an += primesum
            if isprime(an): primesum += an
            yield an
    print(list(islice(agen(), 40))) # Michael S. Branicky, Feb 19 2025

A381150 a(0) = 1, a(1) = 2, a(2) = 3; thereafter, a(n) = a(n-1) + (sum of prior prime terms or whose negatives are prime) - (sum of prior composite terms or whose negatives are composite).

Original entry on oeis.org

1, 2, 3, 8, 5, 7, 16, 9, -7, -30, -23, -39, -16, 23, 85, 62, -23, -131, -370, -239, -347, -802, -455, 347, 1496, 1149, -347, -2190, -1843, 347, 2884, 2537, -347, -3578, -3231, 347, 4272, 3925, -347, -4966, -4619, 347, 5660, 5313, -347, -6354, -6007, -11667, -5660
Offset: 0

Author

James C. McMahon, Feb 15 2025

Keywords

Examples

			For n=5, a(5) = 5 + (2 + 3 + 5) - 8 = 7.
For n=9, a(9) = -7 + (2 + 3 + 5 + 7 -7) - (8 + 16 + 9) = -7 + 10 - 33 = -30
		

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<1, 0, b(n-1)+(t->
         `if`(isprime(abs(t)), t, `if`(abs(t)>1, -t, 0)))(a(n)))
        end:
    a:= proc(n) option remember; `if`(n<3, n+1, a(n-1)+b(n-1)) end:
    seq(a(n), n=0..48);  # Alois P. Heinz, Feb 15 2025
  • Mathematica
    Nest[Append[#,#[[-1]]+Total[Select[#,PrimeQ]]-Total[Select[#,CompositeQ]]]&,{1,2,3},46]
Showing 1-7 of 7 results.