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.

User: Soumil Mandal

Soumil Mandal's wiki page.

Soumil Mandal has authored 2 sequences.

A270926 Numbers k such that k*R(k) can be represented as the sum of two nonzero squares, where R(k) is the reverse of the decimal expansion of k.

Original entry on oeis.org

5, 10, 15, 16, 18, 20, 25, 30, 37, 40, 50, 51, 52, 55, 58, 60, 61, 70, 73, 78, 80, 81, 85, 87, 89, 90, 98, 100, 101, 104, 106, 109, 110, 111, 122, 125, 128, 145, 146, 148, 149, 150, 159, 160, 162, 164, 165, 168, 169, 174, 176, 180, 181, 192, 195, 198, 200, 202, 208, 212, 220, 221, 222
Offset: 1

Author

Soumil Mandal, Mar 26 2016

Keywords

Comments

k*R(k) is the square of the hypotenuse of a right triangle.
Palindromes in this sequence are 5, 55, 101, 111, 181, 202, 212, 222, 232, 272, 292, 303, 313, 323, 333, 353, 373, ... - Altug Alkan, Mar 26 2016

Examples

			For k=5, R(k)=5 and k*R(k)=25, which is 3^2 + 4^2.
For k=10, R(k)=1 and k*R(k)=10, which is 1^2 + 3^2.
For k=58, R(k)=85 and k*R(k)=4930, which is 13^2 + 69^2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range@ 222, Length[PowersRepresentations[# FromDigits@ Reverse@ IntegerDigits@ #, 2, 2] /. {0, } -> Nothing] > 0 &] (* _Michael De Vlieger, Mar 26 2016 *)
    stnzsQ[{a_,b_}]:=AllTrue[{a,b},IntegerQ[Sqrt[#]]&]; Select[Range[ 250], Length[ Select[IntegerPartitions[#  IntegerReverse[#],{2}],stnzsQ]] >0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 12 2020 *)
  • PARI
    isA000404(n) = {for( i=1, #n=factor(n)~%4, n[1, i]==3 && n[2, i]%2 && return); n && ( vecmin(n[1, ])==1 || (n[1, 1]==2 && n[2, 1]%2))}
    lista(nn) = for(n=1, nn, if(isA000404(n*eval(concat(Vecrev(Str(n))))), print1(n, ", "))); \\ Altug Alkan, Mar 26 2016
    
  • Python
    # Soumil Mandal, Mar 27 2016
    def isHypotenuse(num):
        a, b = 1, 1
        a2, b2 = a**2, b**2
        while a2 + b2 <= num:
            while a2 + b2 <= num:
                if a2 + b2 == num:
                    return True
                b += 1
                b2 = b**2
            a += 1
            a2 = a**2
            b = 1
            b2 = b**2
        return False
    for x in range(20000):
        if isHypotenuse(x * int(str(x)[::-1])):
            print(x)

Extensions

More terms from Altug Alkan, Mar 26 2016

A270343 Numbers k that end with ( sum of digits of k )^2.

Original entry on oeis.org

0, 1, 81, 3144, 3256, 6225, 6484, 6576, 7121, 7529, 7676, 9100, 9324, 9361, 9729, 9784, 12144, 12256, 15225, 15484, 15576, 16121, 16529, 16676, 18100, 18324, 18361, 18729, 18784, 21144, 21256, 24225, 24484, 24576, 25121
Offset: 1

Author

Soumil Mandal, Mar 15 2016

Keywords

Comments

All terms end with a digit from the set S = {0,1,4,5,6,9}.
The sum of the digits of the numbers repeat and also change with regular intervals. For example, the sum of the digits S1 = {12,16,15,22,24,11,23,26,10,18,19,27,28} which is followed by 3144 to 8784, 12144 to 18784, 21144 to 27784, 30144 to 36784. Again S2 = {21,25,15,22,24,11,23,26,10,18,19,27,28} is followed by 39441 to 45784, 48441 to 54784, 57441 to 67784, 66441 to 72784. It can be seen that a set containing 13 elements repeats itself for 4 consecutive ranges.

Examples

			For k=3256, sum of digits is 16 and 16^2 is 256.
For k=7121, sum of digits is 11 and 11^2 is 121.
For k=18784, sum of digits is 22 and 22^2 is 484.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 20000], Function[n, Function[k, If[n >= k, FromDigits@ Take[#, -IntegerLength@ k] == k, False]][Total[#]^2] &@ IntegerDigits@ n]] (* Michael De Vlieger, Mar 15 2016 *)
    esdQ[n_]:=Module[{idn=IntegerDigits[n],idn2=IntegerDigits[ Total[ IntegerDigits[ n]]^2]},Take[ idn,-Length[idn2]]==idn2]; Select[ Range[ 0,26000],esdQ]//Quiet (* Harvey P. Dale, Jan 01 2022 *)
  • PARI
    isok(n) = {sds = sumdigits(n)^2; nbs = #Str(sds); ((n - sds) % 10^nbs) == 0;} \\ Michel Marcus, Mar 16 2016
    
  • Python
    for i in range(0,200000):
        res = pow((sum(map(int,str(i)))),2)
        if(i%pow(10,len(str(res)))==res):print(i)
    # Soumil Mandal, Mar 17 2016