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.

A283501 Remainder when sum of first n terms of A004001 is divided by 2*n.

Original entry on oeis.org

1, 2, 4, 6, 9, 1, 3, 5, 8, 12, 17, 22, 2, 6, 10, 14, 19, 25, 32, 0, 6, 13, 21, 29, 38, 47, 2, 10, 18, 26, 34, 42, 51, 61, 2, 12, 23, 34, 46, 59, 73, 3, 16, 30, 44, 59, 74, 89, 7, 22, 37, 53, 69, 85, 102, 7, 22, 37, 53, 69, 85, 101, 117, 5, 20, 36, 53, 71, 90, 110, 130, 7, 27
Offset: 1

Views

Author

Altug Alkan, Mar 09 2017

Keywords

Comments

Sequence represents b(n, 2) where b(n, i) = (Sum_{k=1..n} A004001(k)) mod (n*i). See also A282891 and corresponding illustration in Links section.

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 12 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 (2*i), i=1..1000); # after Robert Israel at A282891
  • Mathematica
    a[1] = a[2] = 1; a[n_] := a[n] = a[a[n - 1]] + a[n - a[n - 1]]; Table[Mod[Total@ Array[a, n], 2 n], {n, 73}] (* Michael De Vlieger, Mar 13 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]) % (2*n))

Formula

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