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.

A103876 a(n) = -1/10 (mod prime(n)): A test for divisibility by the n-th prime.

This page as a plain text file.
%I A103876 #53 Feb 06 2025 07:53:29
%S A103876 2,1,9,5,17,16,26,3,11,4,30,14,37,53,6,20,7,51,71,58,80,29,10,72,32,
%T A103876 98,79,38,13,41,125,134,15,47,114,50,121,161,18,19,135,59,179,21,156,
%U A103876 68,206,163,215,24,25,77,184,242,27,83,28,198,205,92,31,219,95,33,101,104
%N A103876 a(n) = -1/10 (mod prime(n)): A test for divisibility by the n-th prime.
%C A103876 Given a number M, remove its last digit d, then subtract d*a(n). If the result is divisible by prime(n), then M is also divisible by prime(n). This process may be repeated.
%C A103876 Values of a(n) can be quickly calculated by finding the smallest multiple of prime(n) which ends in a 1, and removing this last digit. E.g., 7 -> 21 -> 2, 11 -> 11 -> 1, 13 -> 91 -> 9, 17 -> 51 -> 5, 19 -> 171 -> 17.
%C A103876 a(n) is the canonical representative, in the interval (0, p), of the inverse of -10, modulo p = prime(n). - _M. F. Hasler_, Feb 03 2025
%D A103876 Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 76-81.
%H A103876 Alois P. Heinz, <a href="/A103876/b103876.txt">Table of n, a(n) for n = 4..20000</a>
%F A103876 a(n) = p - (10 mod p)^(-1) where p = prime(n). - _Joerg Arndt_, Jan 23 2023
%p A103876 a:= n-> -1/10 mod ithprime(n):
%p A103876 seq(a(n), n=4..69);  # _Alois P. Heinz_, Feb 03 2025
%t A103876 a[n_] := Block[{p = Prime[n], k = 1}, While[ Mod[10k + 1, p] != 0, k++ ]; k]; Table[ a[n], {n, 4, 69}]
%t A103876 PowerMod[-10, -1, Prime[Range[4, 100]]] (* _Paolo Xausa_, Feb 06 2025 *)
%o A103876 (Python)
%o A103876 import sympy
%o A103876 [pow(-10, -1, p) for p in sympy.primerange(7,300)]
%o A103876 # _Nicholas Stefan Georgescu_, Jan 17 2023
%o A103876 (PARI) vector(66,n, my(p=prime(n+3)); p-lift(Mod(10,p)^-1)) \\ _Joerg Arndt_, Jan 23 2023
%o A103876 (PARI) a(n)=lift(-1/Mod(10,prime(n)));
%o A103876 apply(a, [4..66]) \\ _M. F. Hasler_, Feb 03 2025
%Y A103876 Cf. A078606, A357913.
%K A103876 nonn,base
%O A103876 4,1
%A A103876 Alfred S. Posamentier (asp2(AT)juno.com) and _Robert G. Wilson v_, Feb 10 2005
%E A103876 Definition edited by _M. F. Hasler_, Feb 03 2025