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.

A283025 Remainder when sum of first n terms of A005185 is divided by n.

Original entry on oeis.org

0, 0, 1, 3, 0, 2, 5, 0, 3, 6, 9, 2, 6, 10, 1, 5, 10, 16, 3, 9, 15, 21, 4, 13, 20, 1, 9, 17, 25, 3, 14, 22, 30, 7, 18, 27, 0, 11, 21, 32, 3, 14, 26, 38, 5, 16, 27, 46, 8, 19, 35, 49, 8, 23, 38, 51, 11, 25, 41, 57, 12, 27, 50, 2, 15, 35, 52, 67, 19, 40, 58, 5, 25, 44, 64, 7, 28, 47, 67, 9, 31, 52, 73, 13, 34, 56, 80, 16, 38, 62, 86, 18
Offset: 1

Views

Author

Altug Alkan, Feb 27 2017

Keywords

Comments

Numbers n such that a(n) = 0 are 1, 2, 5, 8, 37, 99, 1580, 42029, ...
Sequence is a mixture of regularity and irregularity. - Douglas Hofstadter, Mar 03 2017

Examples

			a(4) = 3 since Sum_{k=1..4} A005185(k) = 1 + 1 + 2 + 3 = 7 and remainder when 7 is divided by 4 is 3.
		

Crossrefs

Programs

  • Maple
    A005185:= proc(n) option remember; procname(n-procname(n-1)) +procname(n-procname(n-2)) end proc:
    A005185(1):= 1: A005185(2):= 1:
    L:= ListTools[PartialSums](map(A005185, [$1..1000])):
    seq(L[i] mod i, i=1..1000); # Robert Israel, Feb 28 2017
  • Mathematica
    h[1]=h[2]=1; h[n_]:=h[n]= h[n-h[n-1]] + h[n-h[n-2]]; Mod[ Accumulate[h /@ Range[100]], Range[100]] (* Giovanni Resta, Feb 27 2017 *)
  • PARI
    a=vector(1000); a[1]=a[2]=1; for(n=3, #a, a[n]=a[n-a[n-1]]+a[n-a[n-2]]); vector(#a, n, sum(k=1, n, a[k]) % n)
    
  • PARI
    first(n)=my(v=vector(n), s); v[1]=v[2]=1; for(k=3, n, v[k]=v[k-v[k-1]]+v[k-v[k-2]]); for(k=1, n, s+=v[k]; v[k]=s%k); v \\ after Charles R Greathouse IV at A282891

Formula

a(n) = (Sum_{k=1..n} A005185(k)) mod n.
a(n) = A076268(n) mod n.