

A137998


Least k such that floor(16^n / 10^k) = 1, 2, 4 or 8 (mod 10), or zero if no such k exists.


1



1, 2, 3, 0, 3, 1, 2, 2, 5, 4, 1, 4, 2, 4, 4, 1, 2, 4, 2, 2, 1, 3, 2, 7, 5, 1, 2, 4, 3, 3, 1, 2, 2, 3, 4, 1, 4, 2, 4, 3, 1, 2, 4, 2, 2, 1, 5, 2, 5, 3, 1, 2, 5, 7, 4, 1, 2, 2, 3, 4, 1, 3, 2, 7, 3, 1, 2, 4, 2, 2, 1, 12, 2, 3, 7, 1, 2, 3, 5, 7, 1, 2, 2, 3, 4, 1, 3, 2, 5, 3, 1, 2, 3, 2, 2, 1, 6, 2, 3, 5, 1, 2, 3, 4, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

Equivalent definition: position of least significant decimal digit in 16^n equal to one of {1,2,4,8}, or zero if none of these occur. Since this is the true meaning, the sequence is flagged "base", even if the actual definition does not explicitly refer to a base.
This is related to A071071, i.e., the conjecture by J. Shallit that {1,2,4,8,65536} is a minimal set for powers of 2 written in base 10. This amounts to saying that any power of 2 contains either a digit among {1,2,4,8}, or 65536 as subword (obtained by deleting zero or more digits of the number).
Any power 2^k ends in a digit among {1,2,4,8} except for k=4n, n>0, in which case 2^k=16^n ends in 6.
The present sequence gives the position of the first digit (starting with units) of these powers which is among {1,2,4,8}. It appears as if 16^4=65536 would be the only power of 2 which does not contain any of these four digits. This would imply the conjecture (and be an even stronger statement).
The sequence has a repeating pattern of length 25 of the form
( 1 2 A B C 1 2 2 D E 1 F 2 G H 1 2 J 2 2 1 K 2 L M )... where AM follow again a repeating pattern:
A=(3,p,q,3,3)... ; C=(3,3,r,s,3)...; D=(t,3,3,3,u)... etc.


LINKS

Table of n, a(n) for n=1..105.
J. Shallit, Minimal primes, J. Recreational Mathematics 30 (2) (19992000), 113117.


EXAMPLE

a(1)=1 since 16^1 has a 1 in position 1 (10^1).
a(2)=2 since 16^2=256 has a 2 in position 2 (10^2).
a(3)=3 since 16^3=4096 has a 4 in position 3 (10^3).
a(4)=0 since 16^4=65536 has no digit 1,2,4 or 8.
If we arrange the terms in a 25 column matrix, we can see the pattern:
[1 2 3 0 3 1 2 2 5 4 1 4 2 4 4 1 2 4 2 2 1 3 2 7 5]
[1 2 4 3 3 1 2 2 3 4 1 4 2 4 3 1 2 4 2 2 1 5 2 5 3]
[1 2 5 7 4 1 2 2 3 4 1 3 2 7 3 1 2 4 2 2 1 12 2 3 7]
[1 2 3 5 7 1 2 2 3 4 1 3 2 5 3 1 2 3 2 2 1 6 2 3 5]
[1 2 3 4 3 1 2 2 5 3 1 3 2 3 8 1 2 5 2 2 1 4 2 3 4]
[1 2 3 4 3 1 2 2 6 5 1 6 2 5 4 1 2 5 2 2 1 3 2 5 4]
[1 2 7 3 3 1 2 2 3 7 1 8 2 7 3 1 2 5 2 2 1 7 2 4 3]
[1 2 4 5 4 1 2 2 3 7 1 3 2 4 3 1 2 4 2 2 1 4 2 3 5]
[1 2 3 4 4 1 2 2 3 7 1 3 2 6 3 1 2 3 2 2 1 4 2 3 8]
[1 2 3 5 3 1 2 2 4 3 1 3 2 3 4 1 2 6 2 2 1 5 2 3 6]
[1 2 3 4 3 1 2 2 9 4 1 5 2 4 5 1 2 8 2 2 1 3 2 4 5] etc.


PROG

(PARI) A137998(n, S=Vec("1248"))={ forstep( i=#n=Vec(Str(16^n)), 1, 1, setsearch(S, n[i]) & return( #ni ))}
(PARI) t=0; matrix(25, 20/*# of rows*/, i, j, A137998(t++))~


CROSSREFS

Cf. A071071.
Sequence in context: A089235 A317948 A051910 * A316590 A080593 A319148
Adjacent sequences: A137995 A137996 A137997 * A137999 A138000 A138001


KEYWORD

base,easy,nonn


AUTHOR

M. F. Hasler, Mar 26 2008


STATUS

approved



