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.

A064550 a(1) = 2, a(n)=a(n-1)+2*Q(n)-n, n > 1 where Q = A005185.

This page as a plain text file.
%I A064550 #24 May 10 2025 23:13:40
%S A064550 1,2,4,7,9,12,16,19,23,26,28,33,37,40,46,49,53,58,62,67,71,74,76,85,
%T A064550 89,92,98,103,107,110,120,123,125,132,140,143,147,154,158,163,169,174,
%U A064550 180,185,189,192,194,211,211,212,222,227,227,234,240,241
%N A064550 a(1) = 2, a(n)=a(n-1)+2*Q(n)-n, n > 1 where Q = A005185.
%H A064550 Reinhard Zumkeller, <a href="/A064550/b064550.txt">Table of n, a(n) for n = 0..10000</a>
%H A064550 Roger L. Bagula, <a href="http://victorian.fortunecity.com/carmelita/435/hofstadterintegers.html">A Simulation of a Prime Type of Sequence: The Hofstadter Integers</a> [broken link]
%p A064550 A064550 := proc(n) option remember; if n=0 then 1 else A064550(n-1)+2*A005185(n-1)(n) - n; fi; end;
%t A064550 q[0] = q[1] = 1;
%t A064550 q[n_] := q[n - q[n - 1]] + q[n - q[n - 2]];
%t A064550 a[1] = 2;
%t A064550 a[n_] := a[n] = a[n - 1] + 2*(q[n] - n/2);
%t A064550 Table[ a[n], {n, 1, 70} ]
%o A064550 (ARIBAS) function a064550(maxarg: integer); var n,r,rm,q: integer; qar: array; begin qar := alloc(array,maxarg + 1); qar[0] := 1; for n := 1 to maxarg do if n < 2 then q := 1; else q := qar[n - qar[n - 1]] + qar[n - qar[n - 2]]; end; qar[n] := q; if n = 1 then r := 2; else r := rm + round(2*(q - n/2)); end; rm := r; write(r," "); end; end; a064550(65);
%o A064550 (Haskell)
%o A064550 a064550 n = a064550_list !! n
%o A064550 a064550_list = 1 : 2 : zipWith3 (\a q n -> a + 2 * q - n)
%o A064550     (tail a064550_list) (drop 2 a005185_list) [2..]
%o A064550 -- _Reinhard Zumkeller_, May 13 2012
%Y A064550 Cf. A064551, A064552, A005185.
%K A064550 nonn,nice,easy
%O A064550 0,2
%A A064550 _Roger L. Bagula_, Oct 08 2001
%E A064550 More terms from _Vladeta Jovovic_, _Klaus Brockhaus_ and _Matthew Conroy_, Oct 09 2001