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.

A064456 A064434(n) = 0.

Original entry on oeis.org

1, 3, 79, 235, 431, 1503, 2943, 6059, 6619, 18911, 54223, 302467995, 1772665631, 2148845167, 5145362667, 129465909327, 212089391807
Offset: 1

Views

Author

Jonathan Ayres (JonathanAyres(AT)btinternet.com), Oct 01 2001

Keywords

Comments

a(18) > 4*10^12. - Donovan Johnson, Jan 19 2011
Also indices n where A079878(n)=1. - R. J. Mathar, Nov 13 2011

Crossrefs

Cf. A064433.

Programs

  • ARIBAS
    : a := 0; for n := 1 to 3000000000 do am := a; a := (am*2 + 1) mod n; if a = 0 then write(n," "); end; end;

Extensions

More terms from Klaus Brockhaus, Oct 04 2001
Offset corrected and a(15)-a(17) from Donovan Johnson, Jan 19 2011

A079878 a(1)=1, then a(n)=2*a(n-1) if 2*a(n-1)<=n, a(n)=2*a(n-1)-n otherwise.

Original entry on oeis.org

1, 2, 1, 2, 4, 2, 4, 8, 7, 4, 8, 4, 8, 2, 4, 8, 16, 14, 9, 18, 15, 8, 16, 8, 16, 6, 12, 24, 19, 8, 16, 32, 31, 28, 21, 6, 12, 24, 9, 18, 36, 30, 17, 34, 23, 46, 45, 42, 35, 20, 40, 28, 3, 6, 12, 24, 48, 38, 17, 34, 7, 14, 28, 56, 47, 28, 56, 44, 19, 38, 5, 10, 20, 40, 5, 10, 20, 40, 1, 2
Offset: 1

Views

Author

Benoit Cloitre, Feb 20 2003

Keywords

Comments

a(A200087(n)) = n and a(m) <> n for m < A200087(n). [Reinhard Zumkeller, Nov 13 2011]

Crossrefs

Cf. A200063 (fixed points), A064456 (positions of 1).

Programs

  • Haskell
    a079878 n = a079878_list !! (n-1)
    a079878_list = 1 : zipWith (\x n -> if x <= n then x else x - n)
                               (map (* 2) a079878_list) [2..]
    -- Reinhard Zumkeller, Nov 13 2011
  • Mathematica
    nxt[{n_,a_}]:={n+1,If[2a<=n+1,2a,2a-n-1]}; Transpose[NestList[nxt,{1,1},80]][[2]] (* Harvey P. Dale, Jul 20 2015 *)
  • PARI
    a=1; for(n=2,100,b=if(sign(2*a-n)-1,2*a,2*a-n); a=b; print1(b,","))
    

Formula

a(n) = A064434(n)+1.
It seems that sum(k=1, n, a(k))/n^2 ->1/4

A330405 a(1) = 0; thereafter a(n) = (a(n-1)^2+1) mod n.

Original entry on oeis.org

0, 1, 2, 1, 2, 5, 5, 2, 5, 6, 4, 5, 0, 1, 2, 5, 9, 10, 6, 17, 17, 4, 17, 2, 5, 0, 1, 2, 5, 26, 26, 5, 26, 31, 17, 2, 5, 26, 14, 37, 17, 38, 26, 17, 20, 33, 9, 34, 30, 1, 2, 5, 26, 29, 17, 10, 44, 23, 58, 5, 26, 57, 37, 26, 27, 4, 17, 18, 49, 22, 59, 26, 20, 31, 62, 45, 24
Offset: 1

Views

Author

Matthew Ryan, Dec 12 2019

Keywords

Comments

Does the value 0 appear infinitely many times? - Rémy Sigrist, Dec 16 2019
From Michael De Vlieger, Jan 26 2020: (Start)
Observations based on a(n) for 1 <= n <= 300000:
The value 0 appears at indices n = {1, 13, 26, 89, 205, 530, 2041, 276205, ...}.
The value 1 appears at indices n = {2, 4, 14, 27, 50, 90, 99, 175, 188, 206, 531, 2042, 5445, 6845, 7200, 18225, 24389, 25215, 37538, 46875, 48672, 53066, 79527, 93900, 147875, 176267, 186576, 196025, 254457, 276206, ...}. Let M be the indices in a(n) where 1 appears.
The subsequence {1, 2, 5, 26} appears with the first term at index n = 27, and apparently for all subsequent indices listed n M.
The subsequence {1, 2, 5, 26, 677} appears with the first term at index n = 2042, and apparently for all subsequent indices listed n M.
A stable next term in the subsequence S = {1, 2, 5, 26, 677} is not yet apparent, given 300000 terms of a(n). (End)

Examples

			a(1) = 0; a(2) = (0^2+1) mod 2 = 1; a(3) = (1^2+1) mod 2 = 2.
		

Crossrefs

Programs

  • Mathematica
    Nest[Append[#1, Mod[#1[[#2 - 1]]^2 + 1, #2]] & @@ {#, Length@ # + 1} &, {0}, 76] (* Michael De Vlieger, Dec 16 2019 *)
  • PARI
    v=0; for (n=1, 77, print1 (v=(v^2+1)%n", ")) \\ Rémy Sigrist, Dec 16 2019

Formula

a(1) = 0; a(n) = (a(n-1)^2+1) mod n.

A357261 a(n) is the number of blocks in the bottom row after adding n blocks to the preceding structure of rows. See Comments and Example sections for more details.

Original entry on oeis.org

1, 3, 3, 3, 4, 1, 3, 1, 5, 4, 3, 3, 4, 6, 1, 3, 6, 3, 1, 7, 5, 3, 2, 2, 3, 5, 8, 1, 3, 6, 1, 6, 3, 1, 9, 6, 3, 1, 10, 7, 4, 2, 1, 1, 2, 4, 7, 11, 1, 3, 6, 10, 3, 9, 4, 12, 5, 11, 5, 13, 5, 11, 4, 12, 7, 3, 14, 8, 2, 12, 8, 5, 3, 2, 2, 3, 5
Offset: 1

Views

Author

John Tyler Rascoe, Oct 08 2022

Keywords

Comments

A structure of rows is built up successively where each n blocks are added onto the preceding structure. The first row has an initial width of 3. After n = 1, n blocks are first added filling in the last row where n - 1 left off.
Once a row is filled a new row is started below it. After adding n blocks, if the final row reached is filled exactly, then the width of the next row is increased by one. Otherwise the width of the next row is the same as the previous.
Assuming the rows are built according to the given algorithm, a(n) is the number of blocks tagged 'n' in the last row that includes a block tagged 'n'." - Peter Luschny, Dec 20 2022
Will this sequence ever reach a point after which a(n) grows linearly? This is the case using an initial width of 2 instead of 3.

Examples

			After blocks 1 and 2, the initial row width 3 is exactly filled and hence the next row (of 3's and 4) is 1 longer.
  |1|2|2|       initial row
  |3|3|3|4|
  |4|4|4|5|
  |5|5|5|5|
  |6|6|6|6|6|
  |6|_|_|_|_|   last row after n=6
For n=6, the structure after blocks 1 through 6 have been added is as shown above and its final row has just one block (one 6) so that a(6) = 1.
		

Crossrefs

Programs

  • Maple
    A357261_list := proc(maxn) local A, g, c, n, r;
    A := []; g := 3; c := 0;
    for n from 1 to maxn do
        r := irem(n + c, g);
        c := r;
        if r = 0 then
            r := g; g := g + 1;
        fi;
        A := [op(A), r];
    od; return A end:
    A357261_list(77); # Peter Luschny, Dec 21 2022
  • PARI
    lista(nn) = my(nbc=3, col=0, list=List()); for (n=1, nn, col = lift(Mod(col+n, nbc)); listput(list, if (col, col, nbc)); if (!col, nbc++);); Vec(list); \\ Michel Marcus, Oct 17 2022
  • Python
    def A357261_list(maxn):
        """Returns a list of the first maxn terms"""
        A = []
        g = 3
        c = 0
        for n in range(1,maxn+1):
            if (n + c)%g == 0:
                A.append(g)
                g += 1
                c = 0
            else:
                A.append((n + c)%g)
                c = A[-1]
        return A
    

A358073 a(n) is the row position of the n-th number n after adding the number n, n times to the preceding triangle. A variant of A357261, see Comments and Examples for more details.

Original entry on oeis.org

1, 2, 3, 3, 4, 6, 4, 3, 3, 4, 6, 9, 13, 6, 21, 16, 33, 15, 34, 18, 3, 25, 12, 36, 25, 51, 18, 46, 15, 45, 16, 48, 21, 55, 30, 6, 43, 21, 60, 40, 81, 24, 67, 12, 57, 4, 51, 99, 49, 99, 3, 55, 108, 15, 70, 126, 36, 94, 6, 66, 127, 42, 105, 22, 87, 6, 73, 141, 63
Offset: 1

Views

Author

John Tyler Rascoe, Oct 29 2022

Keywords

Comments

A triangle is built up successively where n appears n times within the triangle. Each row has a set width before n is added, and the first row begins with a width of 1.
Numbers n are added to the first open position within the triangle or where the previous n left off so that no gaps are left in the rows of the triangle. If the row position of the n-th number n placed is the rightmost position within that row, then the width of the next row is increased by n. Otherwise, the width of the next row stays the same as the previous one.
The next row's width can only increase after a given n is added all n times. So when a row is filled after adding fewer than n n's, the next row, by definition, will have the same width.

Examples

			After 5 is added 5 times, the fifth 5 falls in the rightmost row position. So the width of the next row is increased by 5.
  |1|       initial row
  |2|2|
  |3|3|3|4|
  |4|4|4|5|
  |5|5|5|5|
  |6|6|6|6|6|6|7|7|7|
  |7|7|7|7|_|_|_|_|_|
a(7) = 4 because the row position of the seventh 7 added is 4.
		

Crossrefs

Programs

  • Maple
    A358073_list := proc(maxn)  local A, g, c, n, r;
    A := []; g := 1; c := 0;
    for n from 1 to maxn do
        r := irem(n + c, g);
        c := r;
        if r = 0 then
            r := g;
            g := g + n;
        fi;
        A := [op(A), r];
    od; return A end:
    A358073_list(69); # Peter Luschny, Dec 21 2022
  • Python
    def A358073_list(maxn):
        """Returns a list of the first maxn terms"""
        A = []
        g = 1
        c = 0
        for n in range(1,maxn+1):
            if (n + c)%g ==0:
                A.append(g)
                g += n
                c = 0
            else:
                A.append((n + c)%g)
                c = A[-1]
        return A
Showing 1-5 of 5 results.