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

A280706 a(n) = Sum_{k=1..n} q(k+1-q(k)), where q(k) = A005185(k); partial sums of A283467.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 10, 13, 16, 19, 23, 26, 30, 35, 39, 44, 49, 54, 60, 66, 72, 78, 86, 92, 100, 108, 116, 124, 132, 142, 150, 159, 169, 179, 189, 200, 211, 221, 232, 243, 254, 266, 278, 290, 302, 314, 330, 340, 354, 368, 380, 394, 410, 424, 438, 454, 468, 484, 500, 516, 532, 552, 568, 585, 606, 622, 639, 658, 678, 698, 719, 740
Offset: 1

Views

Author

Antti Karttunen after Altug Alkan's A284173, Mar 22 2017

Keywords

Crossrefs

Partial sums of A283467.

Programs

  • Mathematica
    a[1] = a[2] = 1; a[n_] := a[n] = a[n - a[n - 1]] + a[n - a[n - 2]]; Accumulate@ Table[a[n + 1 - a[n]], {n, 72}] (* Michael De Vlieger, Mar 22 2017 *)
  • PARI
    a(n) = if(n<3, 1, a(n - a(n - 1)) + a(n - a(n - 2)));
    for(n=1, 72, print1(sum(k=1, n, a(k + 1 - a(k))),", ")) \\ Indranil Ghosh, Mar 22 2017
  • Scheme
    ;; Code for A005185 given under that entry.
    ;; With memoization-macro definec:
    (definec (A280706 n) (if (= 1 n) 1 (+ (A280706 (- n 1)) (A283467 n))))
    ;; As an explicit sum (slower):
    (define (A280706 n) (add (lambda (k) (A005185 (- (+ k 1) (A005185 k)))) 1 n))
    ;; Implements sum_{i=lowlim..uplim} intfun(i)
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))
    

Formula

a(1) = 1, for > 1, a(n) = A283467(n) + a(n-1).
A284173(n) = a(n) modulo n.

A286559 Compound filter (the left & right summand of Hofstadter Q-sequence): a(n) = P(Q(n-Q(n-1)), Q(n-Q(n-2))), where P(n,k) is sequence A000027 used as a pairing function, with a(1) = a(2) = 0.

Original entry on oeis.org

0, 0, 1, 2, 2, 5, 8, 8, 13, 13, 13, 25, 24, 25, 41, 32, 41, 50, 50, 61, 61, 61, 61, 113, 84, 86, 113, 113, 113, 113, 181, 128, 129, 181, 200, 163, 182, 221, 200, 221, 242, 242, 265, 265, 265, 265, 265, 481, 263, 290, 420, 363, 314, 422, 420, 365, 481, 420, 481, 481, 481, 481, 761, 512, 452, 687, 577, 513, 722, 761, 650, 687, 762, 723, 760, 722, 842, 760, 801
Offset: 1

Views

Author

Antti Karttunen, May 18 2017

Keywords

Crossrefs

Programs

Formula

a(1) = a(2) = 0, for n > 2, a(n) = (1/2)*(2 + ((A005185(n-A005185(n-1))+A005185(n-A005185(n-2)))^2) - A005185(n-A005185(n-1)) - 3*A005185(n-A005185(n-2))).

A284173 a(n) = (Sum_{k=1..n} q(k+1-q(k))) mod n where q(k) = A005185(k).

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 3, 5, 7, 9, 1, 2, 4, 7, 9, 12, 15, 0, 3, 6, 9, 12, 17, 20, 0, 4, 8, 12, 16, 22, 26, 31, 4, 9, 14, 20, 26, 31, 37, 3, 8, 14, 20, 26, 32, 38, 1, 4, 11, 18, 23, 30, 39, 46, 53, 6, 12, 20, 28, 36, 44, 56, 1, 9, 21, 28, 36, 46, 57, 68, 9, 20, 30, 39, 48, 60, 69, 2, 12
Offset: 1

Views

Author

Altug Alkan, Mar 21 2017

Keywords

Comments

Sequence represents d(n, 1, 1) where d(n, i, j) = (Sum_{k=1..n} q(k+j-q(k))) mod (n*i) where q(k) = A005185(k).

Crossrefs

Programs

  • Maple
    N:= 1000: # to get a(1) to a(N)
    B[1]:= 1:
    B[2]:= 1:
    for n from 3 to N do
      B[n]:= B[n-B[n-1]] + B[n-B[n-2]];
    od:
    seq(add(B[k+1-B[k]], k=1..n) mod n, n=1..N); # Robert Israel, Mar 22 2017
  • Mathematica
    q[n_]:=If[n<3, 1, q[n - q[n - 1]] + q[n - q[n - 2]]]; a[n_]:=Mod[Sum[q[k + 1 - q[k]],{k, n}], n]; Table[a[n], {n, 100}] (* Indranil Ghosh, Mar 21 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+1-a[k]]) % n)
    
  • Scheme
    (define (A284173 n) (modulo (A280706 n) n)) ;; Other code as in A280706, A283467 and A005185 - Antti Karttunen, Mar 22 2017

Formula

a(n) = A280706(n) mod n. - Antti Karttunen, Mar 22 2017
Showing 1-3 of 3 results.