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.

A036059 The summarize Fibonacci sequence: summarize the previous two terms!.

Original entry on oeis.org

1, 1, 21, 1221, 3231, 233231, 533221, 15534221, 3514334231, 3534533241, 3544832231, 183544733221, 28172544634231, 2827162554535241, 2827265554337241, 2837267544338231, 3847264544637221, 3847362564636221, 2837662564536221, 2827863534537221, 3837564524538221
Offset: 0

Views

Author

Keywords

Comments

After the 23rd term the sequence goes into a cycle of 16 terms.

Examples

			a(20) = 3837564524538221;
a(21) = 4837265534637221;
a(22+16*k) = 3837365544636221, k >= 0;
a(36) = a(20+16) = 3837265554834221 <> a(20);
a(37) = a(21+16) = 3837266544735221 <> a(21);
a(38) = a(22+16) = 3837365544636221 = a(22). - _Reinhard Zumkeller_, Aug 10 2014
		

Crossrefs

Programs

  • Haskell
    import Data.List (sort, group)
    a036059 n = a036059_list !! n
    a036059_list = map (read . concatMap show) fss :: [Integer] where
       fss = [1] : [1] : zipWith h (tail fss) fss where
             h vs ws = concatMap (\us -> [length us, head us]) $
                       group $ reverse $ sort $ vs ++ ws
    -- Reinhard Zumkeller, Aug 10 2014
    
  • Maple
    a:= proc(n) option remember; `if`(n<2, 1, (p-> parse(cat(seq((c->
         `if`(c=0, [][], [c, 9-i][]))(coeff(p, x, 9-i)), i=0..9))))(
          add(x^i, i=map(x-> convert(x, base, 10)[], [a(n-1),a(n-2)]))))
        end:
    seq(a(n), n=0..20);  # Alois P. Heinz, Jun 18 2022
  • Mathematica
    a[0] = a[1] = 1; a[n_] := a[n] = FromDigits @ Flatten @ Reverse @ Select[ Transpose @ { DigitCount[a[n-1]] + DigitCount[a[n-2]], Append[ Range[9], 0]}, #[[1]] > 0&];
    Table[a[n], {n, 0, 18}] (* Jean-François Alcover, Dec 30 2017 *)
  • Python
    def aupton(nn):
      alst = [1, 1]
      for n in range(2, nn+1):
        prev2, anstr = sorted(str(alst[-2]) + str(alst[-1])), ""
        for d in sorted(set(prev2), reverse=True):
          anstr += str(prev2.count(d)) + d
        alst.append(int(anstr))
      return alst
    print(aupton(20)) # Michael S. Branicky, Feb 02 2021