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.

A282894 Remainder when sum of first n terms of A004001 is divided by A004001(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 4, 4, 6, 6, 6, 6, 6, 7, 9, 0, 0, 2, 5, 5, 8, 8, 8, 10, 10, 10, 10, 10, 9, 9, 10, 12, 15, 15, 18, 22, 3, 3, 7, 12, 12, 17, 17, 17, 21, 26, 26, 1, 1, 1, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 2, 0, 34, 35, 0, 2, 2, 4, 7, 11, 16, 16, 21, 27, 34, 34, 41, 2, 2, 9, 9, 9, 15, 22, 30, 30, 38, 47, 47, 2, 2, 2
Offset: 1

Views

Author

Altug Alkan, Feb 24 2017

Keywords

Examples

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

Crossrefs

Programs

  • Maple
    A004001:= proc(n) option remember; procname(procname(n-1)) +procname(n-procname(n-1)) end proc:
    A004001(1):= 1: A004001(2):= 1:
    L:= ListTools[PartialSums](map(A004001, [$1..1000])):
    seq(L[i] mod A004001(i), i=1..1000); # Robert Israel, Feb 26 2017
  • Mathematica
    a[1] = 1; a[2] = 1; a[n_] := a[n] = a[a[n - 1]] + a[n - a[n - 1]]; MapIndexed[Last@ QuotientRemainder[#1, a@ First@ #2] &, Accumulate@ Table[a@ n, {n, 96}]] (* Michael De Vlieger, Feb 24 2017, after Robert G. Wilson v at A004001 *)
  • PARI
    a=vector(1000); a[1]=a[2]=1; for(n=3, #a, a[n]=a[a[n-1]]+a[n-a[n-1]]); vector(#a, n, sum(k=1, n, a[k]) % a[n])
    
  • PARI
    first(n)=my(v=vector(n),s); v[1]=v[2]=1; for(k=3, n, v[k]=v[v[k-1]]+v[k-v[k-1]]); for(k=1,n, s+=v[k]; v[k]=s%v[k]); v \\ Charles R Greathouse IV, Feb 26 2017

Formula

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