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

A096777 a(n) = a(n-1) + Sum_{k=1..n-1}(a(k) mod 2), a(1) = 1.

Original entry on oeis.org

1, 2, 3, 5, 8, 11, 15, 20, 25, 31, 38, 45, 53, 62, 71, 81, 92, 103, 115, 128, 141, 155, 170, 185, 201, 218, 235, 253, 272, 291, 311, 332, 353, 375, 398, 421, 445, 470, 495, 521, 548, 575, 603, 632, 661, 691, 722, 753, 785, 818, 851, 885, 920, 955, 991, 1028
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 09 2004

Keywords

Comments

a(n) = a(n-1) + (number of odd terms so far in the sequence). Example: 15 is 11 + 4 odd terms so far in the sequence (they are 1,3,5,11). See A007980 for the same construction with even integers. - Eric Angelini, Aug 05 2007
A016789 and A032766 give positions where even and odd terms occur; a(3*n)=A056106(n); a(3*n-1)=A077588(n); a(3*n-2)=A056108(n). - Reinhard Zumkeller, Dec 29 2007

Examples

			G.f. = x + 2*x^2 + 3*x^3 + 5*x^4 + 8*x^5 + 11*x^6 + 15*x^7 + 20*x^8 + ... - _Michael Somos_, Apr 18 2020
		

Crossrefs

Programs

Formula

a(n+1) - a(n) = A004396(n).
a(n) = floor(n/3) * (3*floor(n/3) + 2*(n mod 3) - 1) + n mod 3 + 0^(n mod 3). - Reinhard Zumkeller, Dec 29 2007
a(n) = floor((n-2)^2/3) + n. - Christopher Hunt Gribble, Mar 06 2014
G.f.: -x*(x^4+1) / ((x-1)^3*(x^2+x+1)). - Colin Barker, Mar 07 2014
Euler transform of finite sequence [2, 0, 1, 1, 0, 0, 0, -1]. - Michael Somos, Apr 18 2020
a(n) = (10 + 3*n*(n - 1) - A061347(n+1))/9. - Stefano Spezia, Sep 22 2022

A101135 a(1)=1. a(n) = a(n-1) + sum of the squares which are among the first (n-1) terms of the sequence.

Original entry on oeis.org

1, 2, 3, 4, 9, 23, 37, 51, 65, 79, 93, 107, 121, 256, 647, 1038, 1429, 1820, 2211, 2602, 2993, 3384, 3775, 4166, 4557, 4948, 5339, 5730, 6121, 6512, 6903, 7294, 7685, 8076, 8467, 8858, 9249, 9640, 10031, 10422, 10813, 11204, 11595, 11986, 12377, 12768
Offset: 1

Views

Author

Leroy Quet, Jun 07 2007

Keywords

Crossrefs

Cf. A097602.
Cf. A131093.

Programs

  • Mathematica
    Block[{a = {1}}, Do[AppendTo[a, a[[n - 1]] + Total@ Select[a, IntegerQ@ Sqrt@ # &]], {n, 2, 46}]; a] (* Michael De Vlieger, Aug 16 2017 *)
  • PARI
    vector(100, n, if(n==1, a_n_1=sum_=1, a_n_1+=sum_; if(ispolygonal(a_n_1, 4), sum_+=a_n_1)); a_n_1) \\ Colin Barker, Feb 20 2015

Extensions

More terms from Reinhard Zumkeller, Jun 14 2007

A374602 Array of successive integer solutions to sqrt((d-c)*b^2 + c*(b+1)^2) for nonsquare integers d >= 2 (d=A000037(n) for n >= 1), where b and c are positive integers and c < d, read by antidiagonals.

Original entry on oeis.org

5, 29, 3, 169, 11, 5, 985, 41, 13, 3, 5741, 153, 34, 7, 4, 33461, 571, 89, 18, 5, 10, 195025, 2131, 233, 29, 11, 11, 4, 1136689, 7953, 610, 69, 28, 23, 5, 7, 6625109, 29681, 1597, 178, 62, 58, 13, 8, 6, 38613965, 110771, 4181, 287, 79, 338, 14, 13, 22, 4
Offset: 1

Views

Author

Charles L. Hohn, Jul 13 2024

Keywords

Comments

T(n,k) is the diagonal lengths of increasingly nearly regular d-dimensional Pythagorean hyperrectangles.
Each row n divides into equal length, geometrically periodic subsequences, each with its own subsequence period length (A377290) and geometric growth factor (A377291); it is conjectured that this is the case for all n, and that all solutions conform as such and that there are no solutions that do not, but these are not proven.
It is also not known if there is an algorithm for generating values for all rows other than testing all possible values for a row until a subsequence pattern emerges.
Square d produce solutions following a different pattern, shown as A375336.

Examples

			n=row index; d=nonsquare integer of index n (A000037(n)):
 n    d   T(n,k)
---+----+-------------------------------------------------------------
 1 |  2 |  5, 29, 169, 985, 5741, 33461, 195025, 1136689, 6625109, ...
 2 |  3 |  3, 11,  41, 153,  571,  2131,   7953,   29681,  110771, ...
 3 |  5 |  5, 13,  34,  89,  233,   610,   1597,    4181,   10946, ...
 4 |  6 |  3,  7,  18,  29,   69,   178,    287,     683,    1762, ...
 5 |  7 |  4,  5,  11,  28,   62,    79,    175,     446,     988, ...
 6 |  8 | 10, 11,  23,  58,  338,   373,    781,    1970,   11482, ...
 7 | 10 |  4,  5,  13,  14,   25,    62,    111,     148,     185, ...
 8 | 11 |  7,  8,  13,  32,   57,   139,    158,     259,     638, ...
 9 | 12 |  6, 22,  39,  69,   82,   125,    306,     543,    1142, ...
10 | 13 |  4,  5,   7,  17,   30,    43,     53,      76,     185, ...
11 | 14 |  9, 11,  14,  19,   46,    81,    267,     329,     418, ...
12 | 15 |  6, 10,  21,  23,   30,    39,     94,     165,     362, ...
13 | 17 | 25, 27,  34,  41,   98,   171,    260,    1649,    1779, ...
14 | 18 |  6, 13,  15,  18,   21,    50,     87,     132,     198, ...
15 | 19 |  5,  7,   8,   9,   11,    31,     34,      37,      56, ...
16 | 20 | 10, 26,  68, 125,  159,   178,    197,     466,     807, ...
17 | 21 |  6,  9,  12,  13,   14,    33,     57,      86,     134, ...
18 | 22 |  5,  7,   8,  17,   18,    19,     31,      64,      77, ...
19 | 23 | 16, 19,  27,  28,   29,    68,    117,     176,     764, ...
20 | 24 |  6,  9,  11,  14,   36,    39,     57,      58,      59, ...
...
sqrt((2-1)*1^2 + 1*(1+1)^2) = sqrt(5) -> not an integer so not included.
sqrt((2-1)*3^2 + 1*(3+1)^2) = 5 -> T(1,1).
sqrt((2-1)*20^2 + 1*(20+1)^2) = 29 -> T(1,2).
sqrt((3-2)*1^2 + 2*(1+1)^2) = 3 -> T(2,1).
sqrt((6-2)*7^2 + 2*(7+1)^2) = 18 -> T(4,3).
		

Crossrefs

Row 1 is A001653 starting at n=2.
Row 2 is A079935 starting at n=2.
Bisection of row 2 starting with the first term is A189356 starting at n=1.
Bisection of row 2 starting with the second term is A122769 starting at n=2.
Row 3 is A001519 starting at n=3.
Bisection of row 3 starting with the first term is A033889 starting at n=1.
Bisection of row 3 starting with the second term is A033891 starting at n=1.
Row 4 is A131093 starting at n=3.

Programs

  • PARI
    row(n, c)=my(v=List(), d=n+floor(sqrt(n)+1/2) /* d=A000037(n) */, t=ceil(sqrt(d))); while(#v
    				

Formula

T(n, 1) = A373666(A000037(n)).

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

Views

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

Views

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
		

Crossrefs

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