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.

A233246 Sum of squares of cycle lengths for different cycles in Fibonacci-like sequences modulo n.

Original entry on oeis.org

1, 10, 65, 82, 417, 650, 769, 658, 1793, 4170, 1151, 3026, 4705, 7690, 7137, 5266, 10369, 7562, 6319, 19218, 6977, 11510, 25345, 12818, 52417, 47050, 48449, 35410, 11565, 71370, 28351, 42130, 39615, 41482, 81057, 30674, 103969, 25282, 80033
Offset: 1

Views

Author

Brandon Avila and Tanya Khovanova, Dec 06 2013

Keywords

Comments

Here Fibonacci-like means a sequence following the Fibonacci recursion: b(n)=b(n-1)+b(n-2). These sequences modulo n cycle. The number of different cycles is A015134(n).
This sequence divided by n^2 is the average cycle length per different starting pairs modulo n, see A233248.
If n is in A064414, then a(n)/n^2 is the average distance between two neighboring multiples of n.
If n is in A064414, then a(n)/2n^2 is the average distance to the next zero over all starting pairs of remainders.

Examples

			For n=4 there are four possible cycles: A trivial cycle of length 1: 0; two cycles of length 6: 0,1,1,2,3,1; and a cycle of length 3: 0,2,2. Hence, a(4)=1+9+36+36=82.
		

Crossrefs

Programs

  • Mathematica
    cl[i_, j_, n_] := (step = 1; first = i; second = j;
      next = Mod[first + second, n];
      While[second != i || next != j, step++; first = second;
       second = next; next = Mod[first + second, n]]; step)
    Table[Total[
      Flatten[Table[cl[i, j, n], {i, 0, n - 1}, {j, 0, n - 1}]]], {n, 50}]

A266295 2-free tetranacci sequence beginning 1,3,5,7.

Original entry on oeis.org

1, 3, 5, 7, 1, 1, 7, 1, 5, 7, 5, 9, 13, 17, 11, 25, 33, 43, 7, 27, 55, 33, 61, 11, 5, 55, 33, 13, 53, 77, 11, 77, 109, 137, 167, 245, 329, 439, 295, 327, 695, 439, 439, 475, 1, 677, 199, 169, 523, 49, 235, 61, 217, 281, 397, 239, 567, 371, 787
Offset: 1

Views

Author

Jeremy F. Alm, Dec 28 2015

Keywords

Comments

For n>4, a(n) = (a(n-1) + a(n-2) + a(n-3) + a(n-4)) / 2^d, where 2^d is the largest power of 2 dividing a(n-1) + a(n-2) + a(n-3) + a(n-4). In other words, sum the previous four terms, then divide by two until the result is odd.

References

  • Alm, Herald, Miller, and Sexton, 2-Free Tetranacci Sequences, unpublished.

Crossrefs

Programs

  • Mathematica
    nxt[{a_, b_, c_, d_}] := {b, c, d, (a + b + c + d)/2^IntegerExponent[ a + b + c + d, 2]}; NestList[nxt,{1,3,5,7},60][[All,1]] (* Harvey P. Dale, Nov 09 2020 *)
  • PARI
    lista(nn) = {print1(x = 1, ", "); print1(y = 3, ", "); print1(z = 5, ", "); print1(t = 7, ", "); for (n=5, nn, tt = (x+y+z+t); tt /= 2^valuation(tt, 2); print1(tt, ", "); x=y; y=z; z=t; t=tt;);} \\ Michel Marcus, Dec 29 2015
  • Python
    ### CREATES A b-FILE ###
    def main():
        name = "b266295.txt"
        file = open(name, 'w')
        file.write('1' + ' ' + '1\n')
        file.write('2' + ' ' + '3\n')
        file.write('3' + ' ' + '5\n')
        file.write('4' + ' ' + '7\n')
        a, b, c, d = 1, 3, 5, 7
        for i in range(5,10001):
            x=a+b+c+d
            while x%2==0:
                x /= 2
            a, b, c, d = b, c, d, x
            file.write(str(i) + ' ' + str(int(d)) + '\n')
        file.close()
    main()
    

Formula

a(n) = (a(n-1) + a(n-2) + a(n-3) + a(n-4)) / 2^d, where 2^d is the largest power of 2 dividing a(n-1) + a(n-2) + a(n-3) + a(n-4).
a(n) = A000265(a(n-1) + a(n-2) + a(n-3) + a(n-4)). - Michel Marcus, Dec 29 2015
Showing 1-2 of 2 results.