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.

A087271 Least number x such that gcd(x, pi(x)) = n.

Original entry on oeis.org

1, 4, 6, 8, 50, 66, 77, 56, 27, 30, 33, 156, 169, 182, 465, 224, 238, 252, 2299, 1380, 189, 902, 207, 96, 100, 1872, 1323, 2464, 1247, 120, 1333, 3168, 528, 1258, 1295, 828, 3441, 2888, 1755, 5800, 1271, 1932, 731, 748, 765, 2852, 2209, 11568, 2695, 4000
Offset: 1

Views

Author

Labos Elemer, Sep 16 2003

Keywords

Examples

			n=253: a(253)=91586, pi(91586)=8855,
gcd(91586, 8855) = 253 first time.
		

Crossrefs

Programs

  • Mathematica
    f[x_] := GCD[x, PrimePi[x]]; t=Table[0, {257}]; Do[s=f[n]; If[s<258&&t[[s]]==0, t[[s]]=n], {n, 1, 100000}]; t
    Module[{tbl=Table[{x,GCD[x,PrimePi[x]]},{x,12000}]},Table[SelectFirst[ tbl,#[[2]]==n&],{n,50}]][[All,1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Feb 12 2020 *)

Formula

a(n) = Min{x; gcd(x, A000720(x))=n}.