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.

A077404 Trajectory of n under the Reverse and Add! operation carried out in base 3 (presumably) does not reach a palindrome.

This page as a plain text file.
%I A077404 #16 Oct 19 2019 12:37:02
%S A077404 103,127,167,176,180,183,185,191,197,200,206,207,209,215,221,230,239,
%T A077404 291,309,318,340,358,369,376,387,394,396,413,418,431,436,449,454,467,
%U A077404 472,582,600,618,636,655,660,673,678,691,696,709,714,746,776,803,805
%N A077404 Trajectory of n under the Reverse and Add! operation carried out in base 3 (presumably) does not reach a palindrome.
%C A077404 Base-3 analog of A066059 (base 2), A075420 (base 4) and A023108 (base 10).
%H A077404 A.H.M. Smeets, <a href="/A077404/b077404.txt">Table of n, a(n) for n = 1..20000</a>
%H A077404 <a href="/index/Res#RAA">Index entries for sequences related to Reverse and Add!</a>
%t A077404 limit = 10^3; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
%t A077404 Select[Range[805],
%t A077404  Length@NestWhileList[# + IntegerReverse[#, 3] &, #, # !=
%t A077404 IntegerReverse[#, 3]  &, 1, limit] == limit + 1 &] (* _Robert Price_, Oct 19 2019 *)
%o A077404 (ARIBAS) m := 900; stop := 1000; for n := 0 to m do c := 0; k := n; b := 1; while b do d := k; rev := 0; while d > 0 do rev := 3*rev + (d mod 3); d := d div 3; end; if k = rev or c = stop then b := 0; else k := k + rev; end; inc(c); end; if c > stop then write(n,","); end; end;
%Y A077404 Cf. A023108, A066059, A075420, A077405.
%K A077404 base,nonn
%O A077404 1,1
%A A077404 _Klaus Brockhaus_, Nov 05 2002
%E A077404 Offset changed to 1 by _A.H.M. Smeets_, Feb 10 2019