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-3 of 3 results.

A098217 Cototients of terms from A098216. By definitions these cototient values are decimal repdigits.

Original entry on oeis.org

0, 2, 4, 4, 3, 6, 8, 8, 7, 8, 9, 5, 9, 22, 11, 7, 44, 44, 66, 33, 88, 11, 33, 55, 88, 55, 99, 111, 77, 33, 99, 99, 111, 77, 77, 111, 55, 333, 55, 77, 444, 99, 333, 333, 77, 111, 77, 99, 77, 77, 777, 888, 888, 111, 99, 999, 777, 111, 99, 99, 555, 111, 999, 999, 999, 111, 1111
Offset: 1

Views

Author

Labos Elemer, Oct 22 2004

Keywords

Comments

It is believed that for every repdigit r>1, inverse[cototient[r]] has solution, usually more than one.

Crossrefs

Programs

  • Mathematica
    ta={{0}};Do[s=Length[Union[IntegerDigits[n-EulerPhi[n]]]]; If[Equal[s, 1]&&!PrimeQ[n], Print[{n, n-EulerPhi[n]}];ta=Append[ta, n]], {n, 1, 100000}];ta=Delete[ta, 1];ta-EulerPhi[ta]

A098213 The values of some algorithm.

Original entry on oeis.org

1, 1, 1, 8, 30, 97, 374, 2185, 7399, 60475, 303535, 2332720, 16630294, 41419087, 599216396
Offset: 1

Views

Author

Labos Elemer, Oct 05 2004

Keywords

Comments

The algorithm: Take n consecutive primes starting with the a(n)-th prime: {p(a(n)), ..., p(a(n)+n-1)}. Calculate the absolute differences abs(p(i)-p(j)) for all relevant pairs i,j. The number of distinct entries of this n X n difference matrix equals binomial(n,2) = n(n-1)/2, the maximum possible. Also a(n) is the earliest index such that this diversity of differences reaches the maximum possible, binomial(n,2).
The diagonal [{p(i)-p(i)}] of difference matrices consists only of zeros and can be disregarded.
The complete diversity of k-1 consecutive prime differences [as in A079007] is a necessary but not sufficient condition for providing binomial(k,2) distinct entries in the corresponding k X k difference matrix of k consecutive primes. Consecutive prime differences are para-diagonal entries in the difference matrix. So the conditions here are stronger than in A079007.
Subscripts at which sequences like A098726, A098206-A098212 reach first their possible maximum, i.e., binomial(k,2) with the corresponding k.

Examples

			At n = 1, 2, 3, the maxima are binomial(n,2) = 0, 1, 3 reached at a(n) = 1, 1, 1 respectively.
For n = 7: a(7) = 374, primes = {p(374), ..., p(80)} = {2551, 2557, 2579, 2591, 2593, 2609, 2617}. Building the 7 X 7 matrix of values of abs(p(i)-p(j)), the number of its distinct positive entries equals binomial(7,2)=21, namely: {2, 6, 8, 12, 14, 16, 18, 22, 24, 26, 28, 30, 34, 36, 38, 40, 42, 52, 58, 60, 66}.
For n = 12: a(12) = 2332720, list of 12 primes = {p(n), ..., p(n+11)} = {38238461, ..., 38238737}. 12 X 12 matrix = {abs(p(i)-p(j))}, number of distinct entries = binomial(12,2) = 66, that of {2, 6, 8, ..., 266, 274, 276}.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = 1, v = Prime[Range[n]]}, While[CountDistinct@ Flatten@ Abs@ Outer[Plus, v, -v] - 1 != Binomial[n, 2], k++; v = Join[v[[2 ;; -1]], {NextPrime[v[[-1]]]}]]; k]; Array[a, 10] (* Amiram Eldar, Feb 23 2025 *)
  • PARI
    s(v) = {my(d = List()); for(i = 1, #v, for(j = 1, i-1, listput(d, abs(v[i] - v[j])))); #Set(d);}
    a(n) = {my(k = 1, v = primes(n), t = n*(n-1)/2, j = 1); while(s(v) != t, k++; v[j] = nextprime(1 + if(j==1, v[n], v[j-1])); j++; if(j > n, j -= n)); k;} \\ Amiram Eldar, Feb 23 2025

Formula

a(n) = PrimePi(A099640(n)). - Amiram Eldar, Feb 23 2025

Extensions

Edited by Jon E. Schoenfield, Oct 27 2019
a(14)-a(15) from Amiram Eldar, Feb 23 2025

A098218 Nonprime numbers whose cototient is a decimal repunits >1 from A002275.

Original entry on oeis.org

35, 121, 231, 327, 535, 1111, 2047, 2407, 2911, 3127, 3327, 20767, 45967, 64111, 75847, 81607, 103927, 177367, 202207, 210767, 224295, 234607, 275647, 277807, 290911, 295447, 305887, 308911, 321407, 333327, 453911, 475967, 586127, 1199327
Offset: 1

Views

Author

Labos Elemer, Oct 22 2004

Keywords

Comments

It is believed that for every repdigit r>1, inverse(cototient(r)) has a solution, usually more than one. For r=1, primes are the solutions.

Examples

			n=1111 and cototient(1111)=111. By accident, both n and its cototient are decimal repunits.
		

Crossrefs

Programs

  • Mathematica
    ta={{0}};Do[s=Length[u=Union[IntegerDigits[n-EulerPhi[n]]]]; If[Equal[s, 1]&&!PrimeQ[n]&&Equal[u, {1}], Print[{n, n-EulerPhi[n]}]; ta=Append[ta, n]], {n, 1, 100000}];ta=Delete[ta, 1];ta-EulerPhi[ta]
Showing 1-3 of 3 results.