OFFSET
1,2
COMMENTS
Is this a permutation of the positive integers?
LINKS
Paul Tek, Table of n, a(n) for n = 1..10000
Paul Tek, Perl program for this sequence
EXAMPLE
+----+---------+------+
+ n | 2^(n-1) | a(n) |
+----+---------+------+
| 1 | 1 | 1 |
| 2 | 2 | 2 |
| 3 | 4 | 4 |
| 4 | 8 | 8 |
| 5 | 16 | 16 |
| 6 | 32 | 3 |
| 7 | 64 | 6 |
| 8 | 128 | 12 |
| 9 | 256 | 25 |
| 10 | 512 | 5 |
| 11 | 1024 | 10 |
+----+---------+------+
PROG
(Perl) See Link section.
(Python)
from itertools import count, islice
def ispal(n): s = str(n); return s == s[::-1]
def agen(): # generator of terms
aset, mink = set(), 1
for n in count(1):
k, target = mink, str(2**(n-1))
while k in aset or not target.startswith(str(k)): k += 1
an = k; aset.add(an); yield an
while mink in aset: mink += 1
print(list(islice(agen(), 65))) # Michael S. Branicky, Nov 07 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paul Tek, Nov 30 2014
STATUS
approved