login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A127937 Length of longest string of consecutive zeros in the base-7 expansion of 2^n. 0

%I #1 May 11 2007 03:00:00

%S 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1,

%T 1,0,0,1,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,2,3,3,3,2,2,1,1,1,2,2,

%U 1,1,1,1,1,2,2,2,1,1,1,1,0,1,2,2,2,2,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,2,2,1

%N Length of longest string of consecutive zeros in the base-7 expansion of 2^n.

%C Is a(n) >= 3 for all n >= 8834?

%e a(42)=2 because the base-7 expansion of 2^42 is 113200616214553321.

%o #!/usr/bin/perl -l $|++; use Math::GMP; use strict; my $n = new Math::GMP 1; my $pow = 0; while (1) { my $base7 = basebexpansionofn(7, $n); my $maxconsecutivezeros = 0; while ($base7 =~ /(0+)/g) { if (length($1) > $maxconsecutivezeros) { $maxconsecutivezeros = length($1); } } print "a($pow)=$maxconsecutivezeros"; $n *= 2; $pow++; } sub basebexpansionofn { my ($b, $n) = @_; return '0' if $n == 0; my $lastdigit = $n % $b; my $firstdigits = ($n - $lastdigit)/$b; return ($firstdigits ? basebexpansionofn($b, $firstdigits) : '').$lastdigit; }

%K nonn

%O 0,39

%A Josh Purinton (joshpurinton(AT)gmail.com), Apr 06 2007

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 8 22:12 EDT 2024. Contains 375759 sequences. (Running on oeis4.)