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.

A136437 a(n) = prime(n) - k! where k is the greatest number such that k! <= prime(n).

This page as a plain text file.
%I A136437 #47 May 05 2025 23:42:35
%S A136437 0,1,3,1,5,7,11,13,17,5,7,13,17,19,23,29,35,37,43,47,49,55,59,65,73,
%T A136437 77,79,83,85,89,7,11,17,19,29,31,37,43,47,53,59,61,71,73,77,79,91,103,
%U A136437 107,109,113,119,121,131,137,143,149,151,157,161,163,173,187,191,193,197,211,217,227,229,233,239,247
%N A136437 a(n) = prime(n) - k! where k is the greatest number such that k! <= prime(n).
%C A136437 How many times does each prime appear in this sequence?
%C A136437 The only value (prime(n) - k!) = 0 is at n=1, where k=2.
%C A136437 Are n=2, k=2 and n=4, k=3 the only occurrences of (prime(n) - k!) = 1?
%C A136437 There exist infinitely many solutions of the form (prime(n) - k!) = prime(n-t), t < n.
%C A136437 Are there infinitely many solutions of the form (prime(n) - k!) = prime(r_1)*...*prime(r_i); r_i < n for all i?
%C A136437 From _Bernard Schott_, Jul 16 2021: (Start)
%C A136437 Answer to the second question is no: 18 other occurrences (n,k) of (prime(n) - k!) = 1 are known today; indeed, every k > 1 in A002981 that satisfies k! + 1 is prime gives an occurrence, but only a third pair (n, k) is known exactly; and this comes for n = 2428957, k = 11 because (prime(2428957) - 11!) = 1.
%C A136437 The next occurrence corresponds to k = 27 and n = X where prime(X) = 1+27! = 10888869450418352160768000001 but index X is not yet available (see A062701).
%C A136437 For the occurrences of (prime(m) - k!) = 1, integers k are in A002981 \ {0, 1}, corresponding indices m are in A062701 \ {1} (only 3 indices are known today) and prime(m) are in A088332 \ {2}. (End)
%H A136437 Jinyuan Wang, <a href="/A136437/b136437.txt">Table of n, a(n) for n = 1..10000</a>
%F A136437 a(n) = prime(n)- k! where k is the greatest number for which k! <= prime(n).
%F A136437 a(n) = A212598(prime(n)). - _Michel Marcus_, Feb 19 2019
%F A136437 a(n) = A000040(n) - A346425(n). - _Bernard Schott_, Jul 16 2021
%e A136437 a(1)  = prime(1)  - 2! =  2 -  2 =  0;
%e A136437 a(2)  = prime(2)  - 2! =  3 -  2 =  1;
%e A136437 a(3)  = prime(3)  - 2! =  5 -  2 =  3;
%e A136437 a(4)  = prime(4)  - 3! =  7 -  6 =  1;
%e A136437 a(5)  = prime(5)  - 3! = 11 -  6 =  5;
%e A136437 a(6)  = prime(6)  - 3! = 13 -  6 =  7;
%e A136437 a(7)  = prime(7)  - 3! = 17 -  6 = 11;
%e A136437 a(8)  = prime(8)  - 3! = 19 -  6 = 13;
%e A136437 a(9)  = prime(9)  - 3! = 23 -  6 = 17;
%e A136437 a(10) = prime(10) - 4! = 29 - 24 =  5.
%p A136437 f:=proc(n) local p,i; p:=ithprime(n); for i from 0 to p do if i! > p then break; fi; od; p-(i-1)!; end;
%p A136437 [seq(f(n),n=1..70)]; # _N. J. A. Sloane_, May 22 2012
%t A136437 a[n_] := Module[{p, k},p = Prime[n];k = 1;While[Factorial[k] <= p, k++];p - Factorial[k - 1]] (* _James C. McMahon_, May 05 2025 *)
%o A136437 (PARI) a(n) = my(k=1, p=prime(n)); while (k! <= p, k++); p - (k-1)!; \\ _Michel Marcus_, Feb 19 2019
%Y A136437 Cf. A135996, A000040, A000142, A212598, A212266.
%Y A136437 Cf. also A002981, A062701, A088332, A346425 (gives k).
%K A136437 easy,nonn
%O A136437 1,3
%A A136437 _Ctibor O. Zizka_, Apr 02 2008
%E A136437 More terms from _Jinyuan Wang_, Feb 18 2019