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.

A274368 Numbers k such that if k is decreased by the sum of its digits and k is decreased by the product of its digits both differences are squares > 0.

This page as a plain text file.
%I A274368 #37 Aug 16 2025 23:52:13
%S A274368 45,48,231,121116,159229,11985489,17514256,51624256,88172137,
%T A274368 228523729,467597425,11112111412,4329279198937,3716589421762641,
%U A274368 23228676113127556,138417183479417732388
%N A274368 Numbers k such that if k is decreased by the sum of its digits and k is decreased by the product of its digits both differences are squares > 0.
%C A274368 It appears that if k is increased by the sum of its digits and k is increased by the product of its digits no two squares are found, except for the trivial k = 2 and k = 8.
%C A274368 The smallest k>8 such that k+A007953(k) and k+A007954(k) are both squares is k = 6469753431969. If a fourth such k exists, it must be larger than 1.6*10^19. - _Giovanni Resta_, Jun 19 2016
%e A274368 45 - (4 + 5) = 36 and 45 - (4 * 5) = 25.
%e A274368 159229 - (1 + 5 + 9 + 2 + 2 + 9) = 157609 (= 397^2) and 159229 - (1*5*9*2*2*9) = 159201 (= 399^2).
%e A274368 From _David A. Corneth_, May 27 2021: (Start)
%e A274368 If the digits of a(n) = x are an anagram of 122599 then the product of digits is 1 * 2 * 2 * 5 * 9 * 9 = 1620 and the sum of digits is 1 + 2 + 2 + 5 + 9 + 9 = 28 as order of addition and multiplication does not matter. So x - 31 = m^2 and x - 1620 = k^2 for some positive integers k and m.
%e A274368 So m^2 - k^2 = (x - 28) - (x - 1620) = 1592 = (m - k)*(m + k). The divisors of 1592 are 1, 2, 4, 8, 199, 398, 796, 1592. Testing possible pairs m-k and m+k gives, among other pairs, (m - k, m + k) = (2, 796). Solving for k gives k = 397 so x = k^2 + 1620 = 397^2 + 1620 = 159229 giving an extra term. (End)
%t A274368 lim = 10^6; s = Select[Range@ lim, IntegerQ@ # && # != 0 &@ Sqrt[# - Times @@ IntegerDigits@ #] &]; t = Select[Range@ lim, IntegerQ@ # && # != 0 &@ Sqrt[# - Total@ IntegerDigits@ #] &]; Intersection[s, t] (* _Michael De Vlieger_, Jun 19 2016 *)
%o A274368 (Python)
%o A274368 def pod(n):
%o A274368     p = 1
%o A274368     for x in str(n):
%o A274368         p *= int(x)
%o A274368     return p
%o A274368 def sod(n):
%o A274368     return sum(int(d) for d in str(n))
%o A274368 def cube(z,p):
%o A274368     iscube=False
%o A274368     y=int(pow(z,1/p)+0.01)
%o A274368     if y**p==z:
%o A274368         iscube=True
%o A274368     return iscube
%o A274368 for c in range(1, 10**8):
%o A274368     aa,ab=c-pod(c),c-sod(c)
%o A274368     if cube(aa,2) and cube(ab,2) and aa>0:
%o A274368        print(c,aa,ab)
%o A274368 (PARI) a007953(n) = sumdigits(n)
%o A274368 a007954(n) = my(d=digits(n)); prod(i=1, #d, d[i])
%o A274368 is(n) = n > 9 && issquare(n-a007953(n)) && issquare(n-a007954(n)) \\ _Felix Fröhlich_, Jun 19 2016
%Y A274368 Cf. A007953, A007954, A009994, A061672.
%Y A274368 Intersection of A066566 and A228187.
%K A274368 nonn,base,more
%O A274368 1,1
%A A274368 _Pieter Post_, Jun 19 2016
%E A274368 a(10)-a(15) from _Giovanni Resta_, Jun 19 2016
%E A274368 a(16) from _David A. Corneth_, May 27 2021