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.

A209247 a(n) = p(p(n)) + p(p( abs(n - p(p(n-1))) )), where p(n) = A188163(n) + 1 - [n=1].

This page as a plain text file.
%I A209247 #35 May 22 2024 09:18:52
%S A209247 1,23,33,40,61,62,65,80,115,116,117,120,125,128,141,199,228,229,230,
%T A209247 231,234,237,238,241,246,249,264,286,289,304,370,403,449,450,451,452,
%U A209247 453,456,459,460,461,464,469,470,473,483,486,496,518,519,522,527,530,543
%N A209247 a(n) = p(p(n)) + p(p( abs(n - p(p(n-1))) )), where p(n) = A188163(n) + 1 - [n=1].
%H A209247 G. C. Greubel, <a href="/A209247/b209247.txt">Table of n, a(n) for n = 2..10000</a>
%t A209247 nmax := 200;
%t A209247 h[n_]:= h[n]= If[n<3, 1, h[h[n-1]] + h[n-h[n-1]]]; (* A004001 *)
%t A209247 A188163[n_]:= For[m=1, True, m++, If[h[m]==n, Return[m]]];
%t A209247 (* define a sequence from A188163 *)
%t A209247 p[n_]:= A188163[n] + 1 - Boole[n==1];
%t A209247 a[n_]:= a[n]= If[n<3, 1, p[p[n]] + p[p[Abs[n-p[p[n-1]]]]]];
%t A209247 Table[a[n], {n, 2, nmax}]
%o A209247 (Magma)
%o A209247 nmax:=200;
%o A209247 h:=[n le 2 select 1 else Self(Self(n-1)) + Self(n - Self(n-1)): n in [1..10*nmax]]; // h = A004001
%o A209247 A188163:= function(n)
%o A209247    for j in [1..8*nmax+1] do
%o A209247        if h[j] eq n then return j; end if;
%o A209247    end for;
%o A209247 end function;
%o A209247 // define a sequence based on A188163
%o A209247 p:= func< n | A188163(n) + 1 - 0^(n-1) >;
%o A209247 A209247:= function(n)
%o A209247    if n le 2 then return 1;
%o A209247    else return p(p(n)) + p(p(Abs(n - p(p(n-1)))));
%o A209247    end if;
%o A209247 end function;
%o A209247 [A209247(n): n in [2..nmax]]; // _G. C. Greubel_, May 20 2024
%o A209247 (SageMath)
%o A209247 @CachedFunction
%o A209247 def h(n): return 1 if (n<3) else h(h(n-1)) + h(n - h(n-1)) # h=A004001
%o A209247 def A188163(n):
%o A209247     for j in range(1,2*n+1):
%o A209247         if h(j)==n: return j
%o A209247 # define a function based on A188163
%o A209247 def p(n): return A188163(n) + 1 - int(n==1)
%o A209247 @CachedFunction
%o A209247 def A209247(n): return 1 if (n<3) else p(p(n)) + p(p(abs(n - p(p(n-1)))))
%o A209247 [A209247(n) for n in range(2,201)] # _G. C. Greubel_, May 20 2024
%Y A209247 Cf. A087873, A188163.
%K A209247 nonn
%O A209247 2,2
%A A209247 _Roger L. Bagula_, Jan 13 2013
%E A209247 Edited by _G. C. Greubel_, Apr 23 2024