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.

A352416 A permutation related to minimal Pell representations: append a 0 after each 2 in the ternary expansion of n, and then replace each place value, say 3^k with k >= 0, by A000129(k+1).

This page as a plain text file.
%I A352416 #13 Jan 05 2025 19:51:42
%S A352416 0,1,4,2,3,9,10,11,28,5,6,16,7,8,21,22,23,57,24,25,62,26,27,67,68,69,
%T A352416 168,12,13,33,14,15,38,39,40,98,17,18,45,19,20,50,51,52,127,53,54,132,
%U A352416 55,56,137,138,139,337,58,59,144,60,61,149,150,151,366,63,64
%N A352416 A permutation related to minimal Pell representations: append a 0 after each 2 in the ternary expansion of n, and then replace each place value, say 3^k with k >= 0, by A000129(k+1).
%C A352416 This sequence is to Pell numbers what A048680 is to Fibonacci numbers.
%C A352416 This sequence is a permutation of the nonnegative integers, with inverse A352417.
%H A352416 Rémy Sigrist, <a href="/A352416/b352416.txt">Table of n, a(n) for n = 0..10000</a>
%H A352416 A. F. Horadam, <a href="https://web.archive.org/web/2024*/https://www.fq.math.ca/Scanned/32-3/horadam2.pdf">Maximal representations of positive integers by Pell numbers</a>, The Fibonacci Quarterly, Vol. 32, No. 3 (1994), pp. 240-244.
%H A352416 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%e A352416 For n = 7:
%e A352416 - the ternary expansion of 7 is "21",
%e A352416 - after appending 0's, we obtain "201",
%e A352416 - so a(7) = 2*A000129(2+1) + 0*A000129(1+1) + 1*A000129(0+1) = 2*5 + 1*1 = 11.
%o A352416 (PARI) a(n) = { my (v=0, t=0, d); for (k=0, oo, if (n, d=n%3; n\=3; if (d==2, t++); if (d, v+=d*([2, 1; 1, 0]^(k+1+t))[2, 1]), return (v))) }
%Y A352416 Cf. A000129, A048680, A317204, A352417 (inverse).
%K A352416 nonn,base
%O A352416 0,3
%A A352416 _Rémy Sigrist_, Mar 15 2022