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.

A005041 A self-generating sequence.

This page as a plain text file.
%I A005041 M0258 #44 Aug 01 2024 23:16:28
%S A005041 1,1,2,2,3,3,4,4,4,5,5,5,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,10,
%T A005041 11,11,11,11,11,12,12,12,12,12,13,13,13,13,13,13,14,14,14,14,14,14,15,
%U A005041 15,15,15,15,15,16,16,16,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18
%N A005041 A self-generating sequence.
%C A005041 See A008620 for run lengths: each k occurs A008620(k+2) times. - _Reinhard Zumkeller_, Mar 16 2012
%D A005041 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A005041 Reinhard Zumkeller, <a href="/A005041/b005041.txt">Table of n, a(n) for n = 0..10000</a>
%H A005041 James Propp, <a href="http://www.jstor.org/stable/2689427">Problem 1047</a>, Math. Mag., 52 (1979), 265.
%H A005041 Jeffrey Shallit, <a href="/A005041/a005041.pdf">Letter to N. J. A. Sloane</a>, Nov 10 1979.  Attached: James Propp, Problem 1047, Math. Mag., 52 (1979), 265. [Annotated scanned copy]
%H A005041 Aaron Snook, <a href="http://www.cs.cmu.edu/afs/cs/user/mjs/ftp/thesis-program/2012/theses/snook.pdf">Augmented Integer Linear Recurrences</a>, Thesis, 2012. - From _N. J. A. Sloane_, Dec 19 2012
%F A005041 For any k in {0, 1, 2, ...} and r in {0, 1, 2}, we have: if n = 6*k + (3/2)*k*(k-1) + r*(k+2), then a(n) = 3*k + r + 1. E.g., for k=3 and r=1, we have n = 6*3 + (3/2)*3*(3-1) + 1*(3+2) = 32 and so a(32) = 3*3 + 1 + 1 = 11. - Francois Jooste (phukraut(AT)hotmail.com), Mar 12 2002
%t A005041 Table[n+1, {n, 0, 20}, {Ceiling[(n+1)/3]+1}] // Flatten (* _Jean-François Alcover_, Dec 10 2014 *)
%o A005041 (Haskell)
%o A005041 a005041 n = a005041_list !! n
%o A005041 a005041_list = 1 : f 1 1 (tail ts) where
%o A005041    f y i gs'@((j,a):gs) | i < j  = y : f y (i+1) gs'
%o A005041                         | i == j = a : f a (i+1) gs
%o A005041    ts = [(6*k + 3*k*(k-1) `div` 2 + r*(k+2), 3*k+r+1) |
%o A005041          k <- [0..], r <- [0,1,2]]
%o A005041 -- _Reinhard Zumkeller_, Mar 16 2012
%Y A005041 Cf. A005038, A005039, A005040, A005043, A005044, A055086, A001462, A082462, A024417, A084500.
%K A005041 nonn,nice,easy
%O A005041 0,3
%A A005041 _N. J. A. Sloane_, _Jeffrey Shallit_
%E A005041 More terms from Samuel Hilliard (sam_spade1977(AT)hotmail.com), Apr 11 2004