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

A073853 Indices of zeros in A079777.

Original entry on oeis.org

0, 5, 9, 12, 24, 45, 60, 65, 179, 764, 1268, 5891, 16135, 29909, 71774, 173310, 200040, 1454560, 2485272, 86430343, 92439810, 115854652, 7208007982, 17016737751, 17589706947, 24531053552, 33113576855, 80692537585, 234365843350, 266484243960, 285357252641, 426388494035, 975986718040, 1505420538689, 43633539697333
Offset: 1

Views

Author

Benoit Cloitre, Sep 02 2002

Keywords

Comments

Let b(1) = b(2) = 1, b(k) = (b(k-1) + b(k-2)) mod k; sequence gives n such that b(n) = 0.
A079777(2^31-1) = 1103802855, and A079777(2^31) = 2117709557.
No further terms below k = 5*10^10, at which point, A079777(k-1) = 6059364906669 and A079777(k) = 29451014544130. - Luca Armstrong, Apr 07 2023

Examples

			b(3) = 2 mod 3 = 2; b(4) = (2+1) mod 4 = 3; b(5) = (3+2) mod 5 = 0, hence a(1) = 5.
		

Crossrefs

A079777(n) = 0.

Programs

  • Java
    class A073853 { public static void main(String [] args) { BigInteger an = BigInteger.ZERO ; BigInteger an1 = BigInteger.ONE ; BigInteger n = new BigInteger("2") ; for( ; ; n = n.add(BigInteger.ONE) ) { BigInteger an2 = an.add(an1).mod(n) ; if ( an2.compareTo(BigInteger.ZERO) == 0 ) System.out.println(n) ; an = an1 ; an1 = an2 ; } } } // R. J. Mathar, Dec 06 2009
  • Mathematica
    a = 0; b = 1; lst = {0}; Do[c = Mod[a + b, n]; If[c == 0, AppendTo[lst, n]; Print@n]; a = b; b = c, {n, 2, 2^31}] (* Robert G. Wilson v *)

Extensions

Corrected and extended by John W. Layman, Jun 11 2003
a(23)-a(26) from Zak Seidov; a(27)-a(28) from John W. Layman; a(29)-a(34) from Charles R Greathouse IV, Dec 09 2009. (These new terms were added by N. J. A. Sloane, Dec 20 2009.)
a(35) from Luca Armstrong, Apr 07 2023

A168360 n-b(n), where b(n) = A079777(n) = (b(n-1)+b(n-2) mod n); b(0)=0, b(1)=1.

Original entry on oeis.org

0, 0, 1, 1, 1, 5, 3, 4, 2, 9, 4, 5, 12, 7, 8, 3, 14, 3, 2, 8, 13, 3, 19, 2, 24, 4, 5, 12, 20, 6, 29, 7, 7, 17, 27, 12, 6, 21, 30, 15, 8, 26, 37, 23, 19, 45, 21, 22, 46, 22, 21, 46, 18, 14, 35, 52, 34, 32, 11, 46, 60, 48, 49, 37, 25, 65, 27, 28, 58, 20, 11, 34, 48, 12, 63, 3, 69, 75, 69, 68
Offset: 0

Views

Author

M. F. Hasler, Dec 05 2009

Keywords

Comments

By definition, 0 <= A079777(n) < n, so this sequence satisfies 0 < a(n) <= n. The sequence A073853 gives the indices for which a(n)=n.

Programs

  • PARI
    a=[0,n=1]; u=[1,1]~; print1("0, 0"); while(n<99, print1(", ",n++-a[1+bittest(n,0)]=a*u%n))

Formula

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

Original entry on oeis.org

1, 1, 0, 1, 1, 2, 3, 5, 0, 5, 5, 10, 3, 0, 3, 3, 6, 9, 15, 5, 0, 5, 5, 10, 15, 0, 15, 15, 2, 17, 19, 5, 24, 29, 19, 13, 32, 8, 2, 10, 12, 22, 34, 13, 3, 16, 19, 35, 6, 41, 47, 37, 32, 16, 48, 9, 1, 10, 11, 21, 32, 53, 23, 13, 36, 49, 19, 1, 20, 21, 41, 62, 31, 20, 51, 71, 46, 40, 8, 48, 56
Offset: 0

Views

Author

Keywords

Comments

Suggested by Leroy Quet.
Three conjectures: (1) All numbers appear infinitely often, i.e., for every number k >= 0 and every frequency f > 0 there is an index i such that a(i) = k is the f-th occurrence of k in the sequence.
(2) a(j) = a(j-1) + a(j-2) and a(j) = a(j-1) + a(j-2) - j occur approximately equally often, i.e., lim_{n->infinity} x_n / y_n = 1, where x_n is the number of j <= n such that a(j) = a(j-1) + a(j-2) and y_n is the number of j <= n such that a(j) = a(j-1) + a(j-2) - j (cf. A122276).
(3) There are sections a(g+1), ..., a(g+k) of arbitrary length k such that a(g+h) = a(g+h-1) + a(g+h-2) for h = 1,...,k, i.e., the sequence is nondecreasing in these sections (cf. A122277, A122278, A122279). - Klaus Brockhaus, Aug 29 2006
a(A197877(n)) = n and a(m) <> n for m < A197877(n); see first conjecture. - Reinhard Zumkeller, Oct 19 2011

Crossrefs

Cf. A079777, A096274 (location of 0's), A096534, A132678.

Programs

  • Haskell
    a096535 n = a096535_list !! n
    a096535_list = 1 : 1 : f 2 1 1 where
       f n x x' = y : f (n+1) y x where y = mod (x + x') n
    -- Reinhard Zumkeller, Oct 19 2011
  • Mathematica
    l = {1, 1}; For[i = 2, i <= 100, i++, len = Length[l]; l = Append[l, Mod[l[[len]] + l[[len - 1]], i]]]; l
    f[s_] := f[s] = Append[s, Mod[s[[ -2]] + s[[ -1]], Length[s]]]; Nest[f, {1, 1}, 80] (* Robert G. Wilson v, Aug 29 2006 *)
    RecurrenceTable[{a[0]==a[1]==1,a[n]==Mod[a[n-1]+a[n-2],n]},a,{n,90}] (* Harvey P. Dale, Apr 12 2013 *)

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

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 8, 6, 6, 12, 8, 9, 17, 13, 16, 14, 14, 28, 24, 14, 18, 32, 28, 14, 18, 32, 24, 29, 25, 25, 50, 44, 30, 41, 37, 8, 9, 17, 26, 43, 29, 31, 60, 48, 20, 23, 43, 66, 61, 29, 40, 69, 57, 20, 23, 43, 66, 52, 60, 53, 53, 106, 97, 77, 46, 58, 104, 95, 63, 89, 82, 29, 39, 68
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 21 2005

Keywords

Comments

a(n) <= a(n-1) + a(n-2) < 2*n for n>0, see A105859 for numbers i such that a(i)=a(i-1)+a(i-2) and A105860 for numbers j with a(j)Reinhard Zumkeller, Apr 23 2005
A105855 = (first differences) and A105856 = (partial sums); records occur at A105857: A105858(n) = a(A105857(n)). - Reinhard Zumkeller, Apr 23 2005

Crossrefs

Programs

  • Mathematica
    Fold[Append[#1, Mod[#1[[-1]], #2] + Mod[#1[[-2]], #2]] &, {0, 1}, Range[2, 73]] (* Ivan Neretin, Jun 18 2018 *)
    nxt[{n_,a_,b_}]:={n+1,b,Mod[a,n+1]+Mod[b,n+1]}; NestList[nxt,{1,0,1},80][[;;,2]] (* Harvey P. Dale, May 12 2025 *)

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

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 1, 6, 7, 3, 10, 1, 11, 12, 8, 4, 12, 16, 9, 5, 14, 19, 10, 5, 15, 20, 8, 0, 8, 8, 16, 24, 7, 31, 3, 34, 0, 34, 34, 28, 21, 7, 28, 35, 18, 7, 25, 32, 8, 40, 48, 36, 31, 13, 44, 1, 45, 46, 32, 18, 50, 6, 56, 62, 53, 49, 35, 16, 51, 67, 47, 42, 16, 58, 74, 56, 53, 31, 5, 36
Offset: 1

Views

Author

Keywords

Crossrefs

A072987 is a closely related sequence.

Programs

  • Maple
    N:= 100: # to get a(1)..a(N)
    A:= Vector(N):
    A[1]:= 0: A[2]:= 1:
    for n from 3 to N do
      A[n]:= A[n-1] + A[n-2] mod n
    od:
    convert(A,list); # Robert Israel, Nov 13 2017
  • Mathematica
    l = {0, 1}; For[i = 3, i <= 100, i++, len = Length[l]; l = Append[l, Mod[l[[len]] + l[[len - 1]], i]]]; l

A352406 The number of terms before reaching zero when starting at n and iterating: f(n) = n, f(n+1) = n+1; f(n+k) = (f(n+k-2) + f(n+k-1)) (mod (n+k)), where k>=2.

Original entry on oeis.org

5, 2, 7, 3, 8, 14, 5, 7, 4, 12, 46, 34, 18, 21, 21, 16, 5, 10, 8, 25, 128, 237, 79, 25, 266, 25, 10, 74, 34, 27, 6, 11, 22, 23, 72, 75, 26, 267, 16, 893, 28, 40, 8, 113, 27, 16, 163, 41, 13, 27, 169, 48, 837, 7, 88, 436, 23, 144, 59, 36, 77, 71, 466, 96, 14, 226, 371, 72, 231, 463, 377, 29
Offset: 0

Views

Author

Scott R. Shannon, Mar 15 2022

Keywords

Comments

The first term corresponds to the number of terms before zero in A079777. This sequence starts at n and counts the number of terms before zero using the same iterative formula.
The sequence shows large variations in its value, e.g., a(496) = 222, a(497) = 1087851. In the first 50000 terms the largest value is a(21897) = 1248976431. In the same range the smallest number greater than 1 not to have appeared is 414, although it is likely all numbers eventually appear.

Examples

			a(0) = 5 as starting at 0 and 1 gives 0+1 % 2 = 1, 1+1 % 3 = 2, 1+2 % 4 = 3, 2+3 % 5 = 0, with five terms before reaching zero. See A079777.
a(1) = 2 as starting at 1 and 2 gives 1+2 % 3 = 0, with two terms before reaching zero. This is the smallest possible value and the only term to equal 2.
a(2) = 7 as starting at 2 and 3 gives 2+3 % 4 = 1, 3+1 % 5 = 4, 1+4 % 6 = 5, 4+5 % 7 = 2, 5+2 % 8 = 7, 2+7 % 9 = 0, with seven terms before reaching zero.
		

Crossrefs

Cf. A079777, A352407 (multiplication).

A333453 Binary concatenation (ignoring leading zeros) of a(n-1) and a(n-2) mod n, starting with a(n) = n for n <= 1.

Original entry on oeis.org

0, 1, 1, 0, 1, 1, 3, 0, 3, 3, 5, 1, 1, 3, 7, 1, 15, 14, 5, 18, 9, 12, 3, 14, 11, 15, 17, 17, 1, 20, 11, 0, 11, 11, 17, 3, 5, 23, 37, 37, 5, 29, 27, 33, 27, 6, 35, 4, 3, 28, 15, 49, 19, 46, 33, 13, 25, 14, 9, 40, 49, 4, 57, 19, 57, 23, 11, 40, 39, 52, 7, 3, 31
Offset: 0

Views

Author

Alois P. Heinz, Mar 21 2020

Keywords

Comments

Value 0 is treated as empty bit string.

Examples

			a(18) = 5 = 239 mod 18, where 239 = 11101111_2 is the binary concatenation 1110_2 = 14 = a(17) and 1111_2 = 15 = a(16).
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, n, (t-> a(n-1)*
          `if`(t=0, 1, 2^(ilog2(t)+1))+t)(a(n-2)) mod n)
        end:
    seq(a(n), n=0..100);

Formula

a(n) = (a(n-1)*A062383(a(n-2)) + a(n-2)) mod n if n > 1, a(n) = n if n < 2.

A352407 The number of terms before reaching zero when starting at n and iterating: f(n) = n, f(n+1) = n+1; f(n+k) = (f(n+k-2) * f(n+k-1)) (mod (n+k)), where k>=2.

Original entry on oeis.org

2, 3, 14, 5, 5, 11, 4, 42, 54, 6, 17, 38, 6, 27, 12, 71, 20, 5, 6, 8, 12, 12, 42, 37, 36, 23, 22, 9, 5, 19, 10, 35, 31, 31, 60, 47, 33, 44, 46, 15, 8, 49, 14, 9, 12, 23, 35, 34, 28, 11, 86, 43, 20, 49, 18, 17, 12, 9, 22, 45, 26, 5, 31, 51, 72, 7, 6, 121, 120, 111, 86, 341, 56, 63, 12, 85, 12, 21
Offset: 0

Views

Author

Scott R. Shannon, Mar 15 2022

Keywords

Comments

This sequences uses the same iterative formula as A352406 except that the two previous terms are multiplied instead of added. See that sequence for further details.
In the first 500000 terms the largest value is a(409758) = 1480452. In the same range the smallest number greater than 1 not to have appeared is 16291, although it is likely all numbers eventually appear.

Examples

			a(0) = 2 as starting at 0 and 1 gives 0*1 % 2 = 0, with two terms before reaching zero. This is the smallest possible value and the only term to equal 2.
a(2) = 14 as starting at 2 and 3 gives 2*3 % 4 = 2, 3*2 % 5 = 1, 2*1 % 6 = 2, 1*2 % 7 = 2, 2*2 % 8 = 4, 2*4 % 9 = 8, 4*8 % 10 = 2, 8*2 % 11 = 5, 2*5 % 12 = 10, 5*10 % 13 = 11, 10*11 % 14 = 12, 11*12 % 15 = 12, 12*12 % 16 = 0, with fourteen terms before reaching zero.
a(3) = 5 as starting at 3 and 4 gives 3*4 % 5 = 2, 4*2 % 6 = 2, 2*2 % 7 = 4, 2*4 % 8 = 0, with five terms before reaching zero.
		

Crossrefs

Cf. A352406 (addition), A079777.
Showing 1-8 of 8 results.