OFFSET
1,1
COMMENTS
Prime numbers in the sequence: 79, 479, 2879, 14243, 26879, 79999, 559571, 589219, ...
The primes of the form 8*10^k-1, for k>0, like 79 or 79999, are terms. See A056721. - Giovanni Resta, Jun 08 2015
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..55 (terms < 6*10^10)
EXAMPLE
sigma(34) = 54 and antisigma(34) = 34*35/2 - 54 = 541, which contains 54 as a substring;
sigma(79) = 80 and antisigma(79) = 79*80/2 - 80 = 3080, which contains 80 as a substring;
sigma(479) = 480 and antisigma(479) = 479*480/2 - 480 = 114480, which contains 480 as a substring.
MAPLE
with(numtheory): P:=proc(q) local a, b, c, d, j, k, n;
for n from 1 to q do a:=sigma(n); c:=ilog10(a)+1; b:=n*(n+1)/2-sigma(n); d:=ilog10(b)+1; for k from 0 to d-c do j:=trunc(b/10^k);
if a=j-trunc(j/10^c)*10^c then print(n); break; fi; od; od; end: P(10^9);
MATHEMATICA
fQ[n_]:=StringMatchQ[ToString[n*(n+1)/2-DivisorSigma[1, n]], ___~~ToString[DivisorSigma[1, n]]~~___]; Select[Range[10^5], fQ[#]&] (* Ivan N. Ianakiev, Jun 18 2015 *)
fQ[n_]:=StringContainsQ[ToString[n*(n+1)/2-DivisorSigma[1, n]], ToString[DivisorSigma[1, n]]]; Select[Range[10^5], fQ[#]&] (* much faster *) (* Ivan N. Ianakiev, Apr 02 2022 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, May 29 2015
EXTENSIONS
a(16)-a(32) from Giovanni Resta, Jun 08 2015
STATUS
approved