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

A125284 Lower indices of duplicate terms in A125204, i.e., k such that A125204(k) = A125204(k + 1).

Original entry on oeis.org

3, 18, 35, 37, 148, 741, 752, 6814, 13976, 150095, 517213, 11874105
Offset: 1

Views

Author

Ryan Propper, Jan 25 2007

Keywords

Examples

			18 is in the sequence because A125204(18) = A125204(19) = 266.
		

Crossrefs

Cf. A125204.

Programs

  • Mathematica
    l = {0, 1}; Do[x = l[[n]] + l[[Mod[l[[n]], n] + 1]]; If[x == l[[n]], Print[n - 1]]; AppendTo[l, x], {n, 2, 10^9}]

A268176 a(0) = a(1) = 1, and a(n) = a(n-1) + a( (a(n-1)-1) mod n ) for n>=2.

Original entry on oeis.org

1, 1, 2, 3, 5, 10, 13, 23, 36, 72, 73, 86, 87, 123, 196, 197, 202, 398, 399, 798, 1196, 1994, 2117, 2118, 2128, 2130, 4248, 4284, 8568, 8655, 8851, 9048, 11166, 11252, 20300, 40600, 44884, 44886, 44909, 45707, 49955, 50157, 50193, 50279, 59130, 118260, 163967
Offset: 0

Views

Author

Christian Perfect, Jan 28 2016

Keywords

Crossrefs

Cf. A125204.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, 1,
           a(n-1)+a(irem((a(n-1)-1), n)))
        end:
    seq(a(n), n=0..50);  # Alois P. Heinz, Apr 08 2016
  • Mathematica
    a[0] = a[1] = 1; a[n_] := a[n] = # + a@ Mod[# - 1, n] &@ a[n - 1]; Array[a, 47, 0] (* Michael De Vlieger, Apr 08 2016 *)
  • PARI
    lista(nn) = {va = vector(nn); print1(va[1] = 1, ", "); print1(va[2] = 1, ", "); for (n=3, nn, va[n] = va[n-1] + va[((va[n-1]-1) % (n-1))+1]; print1(va[n], ", "););} \\ Michel Marcus, Apr 08 2016
    
  • Python
    from sympy.core.cache import cacheit
    @cacheit
    def a(n): return 1 if n<2 else a(n - 1) + a((a(n - 1) - 1)%n)
    print([a(n) for n in range(51)]) # Indranil Ghosh, Aug 06 2017
Showing 1-2 of 2 results.