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.

Showing 1-4 of 4 results.

A231155 Largest k such that no sum of digits is divisible by n (zeros not allowed in the digits of k).

Original entry on oeis.org

9, 88, 999, 9999, 77777, 999999, 9999999, 88888888, 999999999, 9999999999, 77777777777, 999999999999, 9999999999999, 88888888888888, 999999999999999, 9999999999999999, 77777777777777777, 999999999999999999, 9999999999999999999
Offset: 2

Views

Author

Jon Perry, Nov 04 2013

Keywords

Comments

a(n) has fewer than n digits, a special case of the fact that n integers always contain a sub(multi)set with a sum divisible by n.
The single digits appear to be periodic with period 210. - T. D. Noe, Nov 05 2013
This follows from the formula. Note also that the only digits which appear are 1, 5, 7, 8, and 9. - Charles R Greathouse IV, Nov 06 2013

Examples

			a(4) = 999 because none of 9, 9+9 or 9+9+9 are divisible by 4. All integers greater than 999 (with no zeros) have the property that some digit sum is divisible by 4, e.g., 1235 has 3+1.
		

Crossrefs

Subsequence of A010785.

Programs

Formula

a(n) consists of n-1 digits of d where d is the largest digit such that GCD(n,d)=1.
a(n) = A231470(n)*(10^(n-1)-1)/9. - M. F. Hasler, Nov 09 2013

Extensions

a(9)-a(20) from Charles R Greathouse IV, Nov 05 2013

A231471 Largest integer less than 11 and coprime to n.

Original entry on oeis.org

10, 9, 10, 9, 9, 7, 10, 9, 10, 9, 10, 7, 10, 9, 8, 9, 10, 7, 10, 9, 10, 9, 10, 7, 9, 9, 10, 9, 10, 7, 10, 9, 10, 9, 9, 7, 10, 9, 10, 9, 10, 5, 10, 9, 8, 9, 10, 7, 10, 9, 10, 9, 10, 7, 9, 9, 10, 9, 10, 7, 10, 9, 10, 9, 9, 7, 10, 9, 10, 9, 10, 7, 10, 9, 8, 9, 10, 7, 10, 9
Offset: 1

Views

Author

M. F. Hasler, Nov 09 2013

Keywords

Comments

Motivated by the m = 10 analog A231470 which in turn was motivated by A231155, simply a repetition of (n-1) times the same digit A231470(n).
Periodic with period 210. Possible values are 1, 5, 7, 8, 9, 10. - Robert Israel, Jul 03 2020

Examples

			a(1) = 10 because 10 is the largest integer less than 11 and it's coprime to 1.
a(2) = 9 because 10 is not coprime to 2 but 9 is.
a(6) = 7 because 10, 9 and 8 are not coprime to 6 = 2*3.
a(210) = 1 because 210 = 2*3*5*7 is not coprime to any number n > 1, n < 11.
		

Crossrefs

Cf. A231475 (analog for 5), A231470 (analog for 10), A231155.

Programs

  • Maple
    f:= proc(n) local k;
    for k from 10 by -1 do if igcd(n,k)=1 then return k fi od
    end proc:
    map(f, [$1..210]); # Robert Israel, Jul 03 2020
  • Mathematica
    Table[m = 10; While[GCD[m, n] != 1, m--]; m, {n, 75}] (* Alonso del Arte, Nov 09 2013 *)
  • PARI
    a(n,m=11)=for(k=1,m,gcd(n,m-k)==1&&return(m-k))

A231475 Largest integer less than 5 and coprime to n.

Original entry on oeis.org

4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4
Offset: 1

Views

Author

M. F. Hasler, Nov 09 2013

Keywords

Examples

			a(1)=4 because this is the largest integer less than 5 and it's coprime to n=1.
a(2)=3 because 4 is not coprime to 2 but 3 is.
a(6)=1 because no other positive integer n<4 is coprime to 6=2*3.
		

Crossrefs

Cf. A231471 (analog for 11), A231470 (analog for 10), A231155.

Programs

  • Mathematica
    Max[Table[If[CoprimeQ[#,d],d,0],{d,4}]]&/@Range[100] (* Harvey P. Dale, Aug 27 2022 *)
  • PARI
    A231475(n, m=5) = for(k=1, m, gcd(n, m-k)==1&&return(m-k));

Formula

a(2k+1) = 4 = 2*2.
a(2k) = 1 if 3|k, otherwise a(2k)=3. - Jon Perry, Nov 09 2013

A231472 Largest integer less than 12 and coprime to n.

Original entry on oeis.org

11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 9, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 9, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 9, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 7, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10
Offset: 1

Views

Author

M. F. Hasler, Nov 09 2013

Keywords

Comments

Values in this sequence are 1, 5, 7, 8, 9, 10, and 11; the average value is 3569/330 = 10.81515.... - Charles R Greathouse IV, Aug 19 2016

Examples

			a(1..10)=11 because this is the largest integer less than 12 and it is coprime to n=1,...,10.
a(11)=10 because 11 is not coprime to 11 but 10 is.
a(22)=9 because 11 and 10 are not coprime to 22=2*11.
a(2310)=1 because 2310=2*3*5*7*11 is not coprime to any number n>1, n<12.
		

Crossrefs

Cf. A231471 (analog for 11), A231470 (analog for 10), A231155.

Programs

  • Mathematica
    Table[SelectFirst[Range[11,1,-1],CoprimeQ[#,n]&],{n,80}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 02 2018 *)
  • PARI
    a(n,m=12)=for(k=1,m,gcd(n,m-k)==1&&return(m-k))
Showing 1-4 of 4 results.