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: Bui Quang Tuan

Bui Quang Tuan's wiki page.

Bui Quang Tuan has authored 8 sequences.

A256495 Palindromes i such that 2*i^2 is a palindrome.

Original entry on oeis.org

0, 1, 2, 11, 101, 111, 1001, 1111, 10001, 10101, 11011, 100001, 101101, 110011, 1000001, 1001001, 1010101, 1100011, 10000001, 10011001, 10100101, 11000011, 100000001, 100010001, 100101001, 101000101, 110000011, 1000000001, 1000110001, 1001001001, 1010000101
Offset: 1

Author

Bui Quang Tuan, Mar 31 2015

Keywords

Comments

Subsequence of palindromes of A256437.
The sequence contains all positive integers of the form: m*10^(i + NumberOfDigit(m)) + m where i is any nonnegative integer and m is any term of A000533.
Also contains 1 + 10^i and 1 + 10^i + 10^(2*i) for all i >= 1. Are there any members with more than four 1's, or any members other than 2 with digits other than 0's and 1's? - Robert Israel, Apr 13 2015

Examples

			Palindrome 11 is in the sequence because 2*11^2 = 242, a palindrome.
		

Crossrefs

Cf. A256437.

Programs

  • Maple
    dmax:= 11: # to get all terms with at most dmax digits
    revdigs:= proc(n)
      local L,i;
      L:= convert(n,base,10);
      add(10^(i-1)*L[-i],i=1..nops(L));
    end proc:
    filter:= proc(n) local L;
      L:= convert(2*n^2,base,10);
      L = ListTools:-Reverse(L)
    end proc:
    A:= {}:
    for d from 1 to dmax do
      if d::even then
         A:= A union select(filter, {seq(10^(d/2)*x + revdigs(x), x=10^(d/2-1)..10^(d/2)-1)})
      else
         m:= (d-1)/2;
         A:= A union select(filter, {seq(seq(10^(m+1)*x + y*10^m + revdigs(x), y=0..9),x=10^(m-1)..10^m-1)})
      fi
    od:
    A;  # if using Maple 11 or earlier, uncomment the next line
    # sort(convert(A,list)); # Robert Israel, Apr 13 2015
  • Mathematica
    palQ[n_] := Block[{d = IntegerDigits@ n}, d == Reverse@ d]; Select[
    Range@ 10000000, palQ@ # && palQ[#^2 + FromDigits[Reverse@ IntegerDigits@ #]^2] &] (* Michael De Vlieger, Mar 31 2015 *)
    Select[Range[0,10101*10^5],AllTrue[{#,2#^2},PalindromeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 26 2020 *)
  • PARI
    ispal(n) = my(d = digits(n)); Vecrev(d) == d;
    lista(nn) = {for (n=0, nn, if (ispal(n) && ispal(2*n^2), print1(n, ", ")););} \\ Michel Marcus, Mar 31 2015

Extensions

a(19)-a(22) from Michel Marcus, Mar 31 2015
a(23)-a(31) from Lars Blomberg, Apr 13 2015

A256437 Nonnegative integers i such that i^2 + reverse(i)^2 is a palindrome.

Original entry on oeis.org

0, 1, 2, 10, 11, 12, 20, 21, 30, 100, 101, 102, 110, 111, 120, 200, 201, 210, 220, 300, 310, 1000, 1001, 1002, 1010, 1011, 1012, 1020, 1021, 1022, 1100, 1101, 1102, 1110, 1111, 1120, 1200, 1201, 1210, 1300, 2000, 2001, 2010, 2011, 2100, 2101, 2110, 2200, 2201
Offset: 1

Author

Bui Quang Tuan, Mar 29 2015

Keywords

Comments

This sequence generates A256398.

Examples

			12 is in the sequence because 12^2 + 21^2 = 585, a palindrome.
		

Crossrefs

Programs

  • Mathematica
    palQ[n_] := Reverse@ IntegerDigits@ n == IntegerDigits@ n; Select[
    Range@2210, palQ[#^2 + FromDigits[Reverse[IntegerDigits@ #]]^2] &] (* Michael De Vlieger, Mar 29 2015 *)
  • PARI
    rev(n)=r=""; d=digits(n); for(i=1, #d, r=concat(Str(d[i]), r)); eval(r);
    ispal(n) = d = digits(n); Vecrev(d) == d;
    isok(n) = ispal(n^2+rev(n)^2) \\ Michel Marcus, Apr 01 2015
    
  • Python
    A256437_list = [i for i in range(10**6) if str(i**2 + int(str(i)[::-1])**2) == str(i**2 + int(str(i)[::-1])**2)[::-1]] # Chai Wah Wu, Apr 09 2015

A256515 Nonpalindromic positive integers k such that the absolute value of k^2 - reverse(k)^2 is a square.

Original entry on oeis.org

56, 65, 5265, 5625, 5656, 6565, 12705, 44370, 50721, 51557, 55517, 56056, 59248, 65065, 71555, 75515, 84295, 139755, 273728, 360145, 481610, 523908, 541063, 557931, 560056, 560439, 565656, 606056, 621770, 650065, 650606, 656565, 697996, 699796, 809325, 827372
Offset: 1

Author

Bui Quang Tuan, Apr 01 2015

Keywords

Examples

			The nonpalindromic number 5265 is a term because abs(5265^2 - 5625^2) = 1980^2.
		

Crossrefs

Cf. A004086 (digit reversal), A202386, A068536.

Programs

  • Magma
    [n: n in [0..10^6] | Intseq(n) ne Reverse(Intseq(n)) and IsSquare(s) where s is Abs(n^2-Seqint(Reverse(Intseq(n)))^2)]; // Bruno Berselli, Apr 01 2015
    
  • Mathematica
    Select[Range[200000], ! PalindromeQ@ # && IntegerQ@ Sqrt@ Abs[#^2 - IntegerReverse[#]^2] &] (* Michael De Vlieger, Mar 02 2022 *)
  • Python
    from sympy.ntheory.primetest import is_square
    def R(n): return int(str(n)[::-1])
    def ok(n): Rn = R(n); return n != Rn and is_square(abs(n**2 - Rn**2))
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Mar 02 2022

A256398 Palindromes of the form i^2 + reverse(i)^2.

Original entry on oeis.org

0, 2, 8, 101, 242, 404, 585, 909, 10001, 12221, 14841, 20402, 24642, 40004, 44244, 48884, 50805, 90009, 96269, 1000001, 1030301, 1080801, 1210121, 1244421, 1298921, 1440441, 1478741, 1690961, 2004002, 2234322, 2468642, 2484842, 4000004, 4050504, 4410144
Offset: 1

Author

Bui Quang Tuan, Mar 28 2015

Keywords

Comments

Is 864666666468 the only term in this sequence that has an even number of digits? - Jon E. Schoenfield, Mar 30 2015
The next terms with an even number of digits are 5807785995877085, 56359464311346495365, and 943614966934439669416349, which are obtained for i = 37939066, 3553782166, 529145826418 (and their reverses). - Giovanni Resta, Aug 22 2025

Examples

			Palindrome 585 is in the sequence because 585 = 12^2 + 21^2.
The smallest term that can be obtained in more than one way is 125484521 = 11020^2 + 2011^2 = 11200^2 + 211^2. Are there any terms that can be obtained in more than two ways? - _Jon E. Schoenfield_, Mar 30 2015
		

Crossrefs

Cf. A002113 (palindromes), A056964 (n+rev(n)).
Cf. A256437.

Programs

  • Mathematica
    Sort@ DeleteDuplicates@ Select[Table[n^2 + FromDigits[Reverse[IntegerDigits@ n]]^2, {n, 10000}], Reverse@ IntegerDigits@ # == IntegerDigits@ # &] (* Michael De Vlieger, Mar 28 2015 *)
  • PARI
    rev(n)=r="";d=digits(n);for(i=1,#d,r=concat(Str(d[i]),r));eval(r)
    v=[];for(n=0,10^4,if(rev(P=(n^2+rev(n)^2))==P,v=concat(v,P)));vecsort(v,,8) \\ Derek Orr, Mar 29 2015

Extensions

Data corrected by Derek Orr, Mar 29 2015

A256370 Positive integers n such that n^4 + (n+1)^4 + (n+2)^4 + (n+3)^4 + (n+4)^4 is prime.

Original entry on oeis.org

7, 25, 97, 115, 145, 169, 223, 247, 343, 379, 385, 421, 541, 577, 601, 607, 673, 691, 751, 847, 895, 961, 997, 1111, 1129, 1237, 1267, 1303, 1327, 1459, 1489, 1555, 1615, 1639, 1657, 1663, 1741, 1765, 1771, 1807, 1819, 1831, 1873, 1903, 1927, 1945, 1951, 1963
Offset: 1

Author

Bui Quang Tuan, Mar 26 2015

Keywords

Comments

NK(n,k) conjecture:
If k + 1 is prime then there are infinitely many primes of form:
NK(n,k) = n^k + (n+1)^k + (n+2)^k + ... + (n+k-1)^k + (n+k)^k
If k + 1 is not prime then gcd(NK(n,k), k + 1) > 1 with any positive integer n.
Some examples in the OEIS:
k = 1, primes of form NK(n,1) are all odd primes A065091.
k = 2, primes of form NK(n,2) is A027864.
k = 4, this sequence generates all primes of form NK(n,4).
All terms == 1 (mod 6). Bunyakovsky's conjecture implies that the sequence is infinite. - Robert Israel, Mar 29 2015

Examples

			7 is in the sequence because 7^4 + 8^4 + 9^4 + 10^4 + 11^4 = 37699 which is prime.
		

Crossrefs

Cf. A027864.

Programs

  • Magma
    [n: n in [0..2*10^3] | IsPrime( n^4 + (n+1)^4 + (n+2)^4 + (n+3)^4 + (n+4)^4)]; // Vincenzo Librandi, Mar 27 2015
    
  • Maple
    F:= unapply(expand(add((n+i)^4,i=0..4)), n):
    select(isprime, [seq(6*i+1,i=1..1000)]); # Robert Israel, Mar 29 2015
  • Mathematica
    Select[Range@ 2000, PrimeQ[#^4 + (# + 1)^4 + (# + 2)^4 + (# + 3)^4 + (# + 4)^4] &] (* Michael De Vlieger, Mar 26 2015 *)
    Position[Partition[Range[2000]^4,5,1],?(PrimeQ[Total[#]]&)]//Flatten (* _Harvey P. Dale, Apr 28 2022 *)
  • Python
    from gmpy2 import is_prime
    A256370_list = [n for n in range(1,10**6) if is_prime(5*n*(n*(n*(n + 8) + 36) + 80) + 354)] # Chai Wah Wu, Mar 29 2015

A256176 Primes formed by concatenating n with n+1 and by concatenating n+2 with n+3.

Original entry on oeis.org

67, 89, 7879, 8081, 9091, 9293, 186187, 188189, 276277, 278279, 426427, 428429, 438439, 440441, 450451, 452453, 600601, 602603, 606607, 608609, 798799, 800801, 816817, 818819, 858859, 860861, 936937, 938939, 960961, 962963, 11401141, 11421143
Offset: 1

Author

Bui Quang Tuan, Mar 18 2015

Keywords

Comments

Subsequence of A030458.
First bisection: A156121.

Examples

			67, 89 are in the sequence because they are primes and 6, 7, 8, 9 are four consecutive integers.
7879, 8081 are in the sequence because they are primes and 78, 79, 80, 81 are four consecutive integers.
186187, 188189 are in the sequence because they are primes and 186, 187, 188, 189 are four consecutive integers.
		

Programs

  • Mathematica
    f[n_] := FromDigits@ Flatten[IntegerDigits /@ Range[n, n + 1]]; {f@ #, f[# + 2]} & /@ Select[Range@ 1200, AllTrue[{f@ #, f[# + 2]}, PrimeQ] &] // Flatten (* Michael De Vlieger, Mar 18 2015 *)
    fd[{a_,b_}]:=FromDigits[Join[IntegerDigits[a],IntegerDigits[b]]]; Select[ {fd[ Take[#,2]],fd[Take[#,-2]]}&/@Partition[Range[1500],4,1],AllTrue[ #,PrimeQ]&]//Flatten (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 17 2018 *)
  • PARI
    lista(nn) = {for (n=1, nn, if (isprime(p=eval(concat(Str(n), Str(n+1)))) && isprime(q=eval(concat(Str(n+2), Str(n+3)))), print1(p, ", ", q, ", ")););} \\ Michel Marcus, Mar 18 2015

A253188 Minimal positive integer k such that n^n >= (n-k)^(n+k).

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59
Offset: 1

Author

Bui Quang Tuan, Mar 24 2015

Keywords

Examples

			a(4) = 1 because 4^4 = 256 > 243 = (4-1)^(4+1).
a(5) = 2 because 5^5 = 3125 > 2187 = (5-2)^(5+2) (but < 4096 = (5-1)^(5+1)).
		

Programs

  • Mathematica
    f[n_] := Block[{k = 1}, While[n^n < (n - k)^(n + k), k++]; k]; Array[f, 120] (* Michael De Vlieger, Mar 24 2015 *)
  • PARI
    a(n) = {k = 1; npn = n^n; while(npn < (n-k)^(n+k), k++); k;} \\ Michel Marcus, Mar 24 2015

A256162 Positive integers a(n) such that number of digits in decimal expansion of a(n)^a(n) is divisible by a(n).

Original entry on oeis.org

1, 8, 9, 98, 99, 998, 999, 9998, 9999, 99998, 99999, 999998, 999999, 9999998, 9999999, 99999998, 99999999, 999999998, 999999999, 9999999998, 9999999999, 99999999998, 99999999999, 999999999998, 999999999999, 9999999999998, 9999999999999
Offset: 1

Author

Bui Quang Tuan, Mar 17 2015

Keywords

Comments

A055642(a(n)^a(n)) = A055642(a(n))*a(n).
1 + floor(log_10(a(n)^a(n))) = a(n)*(1 + floor(log_10(a(n)))).

Examples

			1^1 = 1 has 1 digit, and 1 is divisible by 1.
8^8 = 16777216 has 8 digits, and 8 is divisible by 8.
98^98 has 196 digits, and 196 is divisible by 98.
		

Crossrefs

Cf. A055642 (Number of digits in decimal expansion of n).

Programs

  • Magma
    [1] cat [10^Floor((n+1)/2)-2*Floor((n+1)/2)+n-1: n in [1..30]]; // Vincenzo Librandi, Mar 18 2015
  • Mathematica
    Select[Range@10000, Mod[IntegerLength[#^#], #] == 0 &] (* Michael De Vlieger, Mar 17 2015 *)
    Join[{1}, Table[(10^Floor[n/2] - 2 Floor[n/2] + n - 2), {n, 2, 30}]] (* Vincenzo Librandi, Mar 18 2015 *)
  • PARI
    isok(n) = !(#digits(n^n) % n); \\ Michel Marcus, Mar 17 2015
    

Formula

a(n) = 10^floor(n/2) - 2*floor(n/2) + n - 2 = 10^floor(n/2)-(1+(-1)^n)/2 - 1 for n>1, a(1) = 1.