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.

A231470 Largest integer less than 10, coprime to n.

This page as a plain text file.
%I A231470 #26 Dec 26 2024 13:36:06
%S A231470 9,9,8,9,9,7,9,9,8,9,9,7,9,9,8,9,9,7,9,9,8,9,9,7,9,9,8,9,9,7,9,9,8,9,
%T A231470 9,7,9,9,8,9,9,5,9,9,8,9,9,7,9,9,8,9,9,7,9,9,8,9,9,7,9,9,8,9,9,7,9,9,
%U A231470 8,9,9,7,9,9,8,9,9,7,9,9,8,9,9,5,9,9,8,9,9,7,9,9,8,9,9,7,9,9
%N A231470 Largest integer less than 10, coprime to n.
%C A231470 Periodic with period 210.
%C A231470 Motivated by A231155(n)=a(n)*(10^(n-1)-1)/9.
%C A231470 a(n) is in {1, 5, 7, 8, 9}. Average value is 253/30 = 8.433.... - _Charles R Greathouse IV_, Oct 13 2022
%H A231470 Harvey P. Dale, <a href="/A231470/b231470.txt">Table of n, a(n) for n = 1..1000</a>
%H A231470 <a href="/index/Rec#order_210">Index entries for linear recurrences with constant coefficients</a>, order 210.
%e A231470 a(210)=1 because 210=2*3*5*7 is not coprime to any number n>1, n<10.
%t A231470 lgi[n_]:=Module[{k=9},While[!CoprimeQ[n,k],k--];k]; Array[lgi,100] (* _Harvey P. Dale_, Dec 26 2024 *)
%o A231470 (PARI) a(n)=for(k=1,9,gcd(n,10-k)==1&&return(10-k))
%o A231470 (PARI) a(n)=n=n%210; (2456570291879305656378327950088507572292988734220585220471023291179171177166614 45448973642646595615830994341498146323777941833948520102560885856758200689935551 394284409822886865709103348710416026442401 \ 9^n)%9+1 \\ _Charles R Greathouse IV_, Oct 13 2022
%Y A231470 Cf. A231475 (analog for 5), A231471 (analog for 11), A231155.
%K A231470 nonn,easy
%O A231470 1,1
%A A231470 _M. F. Hasler_, Nov 09 2013