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!)
A144049 Number of different cycles of digits in the hexadecimal (base-16) expansions of 1/p, 2/p, ..., (p-1)/p where p = n-th prime different from 2. 0
2, 4, 2, 2, 4, 8, 2, 2, 4, 6, 4, 8, 6, 2, 4, 2, 4, 2, 2, 8, 2, 2, 8, 8, 4, 2, 2, 12, 16, 18, 2, 8, 2, 4, 10, 12, 2, 2, 4, 2, 4, 2, 8, 4, 2, 2, 6, 2, 12, 8, 2, 40, 10, 64, 2, 4, 2, 12, 8, 6, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Table of n, a(n) for n=1..61.

EXAMPLE

For n=3, p=7. 1/7 in hexadecimal = 0.249249249... with a period of 3. (p-1)/3 = 2. a(3)=2.

PROG

(C#.NET)

public static void Main() { int b = 16; for( int n = 3; n < 300; n += 2 ) { if( !IsPrime( n ) ) { continue; } if( b % n == 0 ) { continue; } int t = 0; int x = 1; while( true ) { t++; x *= b; int d = x / n; x %= n; if( x == 1 ) { break; } } Console.Write( (double)(n-1) / t ); Console.Write(", "); } } private static bool IsPrime( int n ) { if( n % 2 == 0 ) { return false; } int test = (int)Math.Floor( Math.Sqrt( n ) ); test -= ( 1 - test % 2 ); while( test >= 3 ) { if( n % test == 0 ) { return false; } test--; } return true; }

CROSSREFS

A006556 for a similar sequence using decimal expansions.

Sequence in context: A340129 A213433 A294354 * A058384 A255671 A330590

Adjacent sequences:  A144046 A144047 A144048 * A144050 A144051 A144052

KEYWORD

easy,nonn,base

AUTHOR

Phil Scovis, Sep 08 2008

STATUS

approved

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 October 2 01:30 EDT 2022. Contains 357191 sequences. (Running on oeis4.)