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.

A022908 The sequence M(n) in A022905.

This page as a plain text file.
%I A022908 #30 Jun 09 2022 02:28:38
%S A022908 0,2,5,11,20,35,56,86,125,179,248,338,449,590,761,971,1220,1523,1880,
%T A022908 2306,2801,3386,4061,4847,5744,6782,7961,9311,10832,12563,14504,16694,
%U A022908 19133,21875,24920,28322,32081,36266,40877,45983,51584
%N A022908 The sequence M(n) in A022905.
%H A022908 T. D. Noe, <a href="/A022908/b022908.txt">Table of n, a(n) for n = 1..1000</a>
%H A022908 J. M. Dover, <a href="http://arxiv.org/abs/1606.08033">On two OEIS conjectures</a>, arXiv:1606.08033 [math.CO], 2016.
%F A022908 a(n) = n + Sum_{k=1..n-1} A022907(k), n > 1. [corrected by _Sean A. Irvine_, May 22 2019]
%F A022908 a(1) = 0; a(n) = (1+3*A033485(2*n-3))/2 = A022905(n-1)+1, n > 1. - _Philippe Deléham_, May 30 2006
%t A022908 (* b = A022905 *) b[1] = 1; b[n_] := b[n] = b[n-1] + 1 + If[EvenQ[n], 2 b[n/2], b[(n-1)/2] + b[(n+1)/2]];
%t A022908 a[1] = 0; a[n_] := b[n-1] + 1;
%t A022908 Array[a, 50] (* _Jean-François Alcover_, Nov 11 2018 *)
%o A022908 (Python)
%o A022908 from itertools import islice
%o A022908 from collections import deque
%o A022908 def A022908_gen(): # generator of terms
%o A022908     aqueue, f, b, a = deque([2]), True, 1, 2
%o A022908     yield from (0,2)
%o A022908     while True:
%o A022908         a += b
%o A022908         aqueue.append(a)
%o A022908         if f:
%o A022908             yield (3*a+1)//2
%o A022908             b = aqueue.popleft()
%o A022908         f = not f
%o A022908 A022908_list = list(islice(A022908_gen(),40)) # _Chai Wah Wu_, Jun 08 2022
%K A022908 nonn
%O A022908 1,2
%A A022908 _Clark Kimberling_