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: John R Phelan

John R Phelan's wiki page.

John R Phelan has authored 9 sequences.

A359491 Numbers k with the property that the set of decimal digits of k matches the set of first digits of the prime factors of k.

Original entry on oeis.org

2, 3, 5, 7, 333, 23532, 33165, 77322, 175175, 232152, 321372, 373212, 515375, 712236, 2249232, 2321232, 2971332, 3372138, 3611322, 4313331, 5773131, 12322332, 23147124, 42323112, 72325232, 113338575, 123221232, 132232224, 172232112, 212322912, 221437272, 273233331
Offset: 1

Author

John R Phelan, Jan 02 2023

Keywords

Comments

Analogous to an acrostic, in which the first digit of each prime factor also forms the number itself.
There could also be a sequence based on the set of decimal digits of k matching the set of last digits of the prime factors of k; 373212 = 2*2*3*3*7*1481 and 73222329312 = 2*2*2*2*2*3*3*11*79*307*953 are examples of numbers in both sequences.

Examples

			a(5)=333 has prime factors 3*3*37, the first digits of which are 3, 3 and 3, matching the set of digits in 333.
a(10)=232152 has prime factors 2*3*2*17*569*2, the first digits of which are 2, 3, 2, 1, 5 and 2, matching the set of digits in 232152.
		

Crossrefs

Cf. A115024.

Programs

  • Java
    See Links
  • PARI
    is(n) = { my (d=digits(n), f=factor(n)); #d==bigomega(f) && vecsort(d) == vecsort(concat(vector(#f~, k, vector(f[k,2], z, digits(f[k,1])[1])))) } \\ Rémy Sigrist, Jan 28 2023
    
  • Python
    from sympy import factorint
    def ok(n): return sorted(str(n)) == sorted(s[0] for s in map(str, factorint(n, multiple=True)))
    print([k for k in range(1, 10**5) if ok(k)]) # Michael S. Branicky, Jan 08 2023
    

A343536 Positive numbers k such that the decimal expansion of k^2 appears in the concatenation of the first k positive integers.

Original entry on oeis.org

1, 428, 573, 725, 727, 738, 846, 7810, 8093, 28023, 36354, 36365, 36464, 63636, 254544, 277851, 297422, 326734, 673267, 673368, 2889810, 4545454, 4545465, 5454547, 5454646, 24275425, 29411775, 47058823, 52941178, 94117748, 146407310, 263157795, 267735365, 285714186
Offset: 1

Author

John R Phelan, Apr 18 2021

Keywords

Comments

A030467 is a subsequence. - Chai Wah Wu, Jun 07 2021

Examples

			428^2 = 183184, which appears in the concatenation of the first 428 positive integers at 183,184, i.e., (183184), so 428 is a term.
725^2 = 525625, which appears in the concatenation of the first 725 positive integers at 255,256,257, i.e., 25(525625)7, so 725 is a term.
		

Crossrefs

Programs

  • Java
    public class Oeis2 {
        public static void main(String[] args) {
            StringBuilder str = new StringBuilder();
            long n = 1;
            while (true) {
                str.append(n);
                if (str.indexOf(String.valueOf(n * n)) >= 0) {
                    System.out.print(n + ", ");
                }
                n++;
            }
        }
    }
    
  • Mathematica
    Select[Range@1000,StringContainsQ[""<>ToString/@Range@#,ToString[#^2]]&] (* Giorgos Kalogeropoulos, Apr 24 2021 *)
    Select[Range[68*10^4],SequenceCount[Flatten[IntegerDigits/@Range[#]],IntegerDigits[#^2]]>0&] (* The program generates the first 20 terms of the sequence. *) (* Harvey P. Dale, Jul 06 2025 *)
  • PARI
    f(n) = my(s=""); for(k=1, n, s=Str(s, k)); s; \\ from A007908
    isok(k) = #strsplit(f(k), Str(k^2)) > 1; \\ Michel Marcus, May 02 2021
    
  • Python
    A343536_list, k, s = [], 1, '1'
    while k < 10**6:
        if str(k**2) in s:
            A343536_list.append(k)
        k += 1
        s += str(k) # Chai Wah Wu, Jun 06 2021

Extensions

More terms from Jinyuan Wang, Apr 30 2021

A343760 Numbers whose digits can be the lengths of the sides of a polygon.

Original entry on oeis.org

111, 122, 133, 144, 155, 166, 177, 188, 199, 212, 221, 222, 223, 232, 233, 234, 243, 244, 245, 254, 255, 256, 265, 266, 267, 276, 277, 278, 287, 288, 289, 298, 299, 313, 322, 323, 324, 331, 332, 333, 334, 335, 342, 343, 344
Offset: 1

Author

John R Phelan, Apr 27 2021

Keywords

Comments

The length of each side must be greater than 0 and less than the sum of the other sides.
Subset of the 0-free numbers, A052382, and eventually contains all the 0-free numbers > 9111111111.

Examples

			110 is not a term since the 3rd side has a length of 0.
111 is a term since a polygon (in this case a triangle) can have sides of length 1,1,1.
112 is not a term since the length of the 3rd side is not less than the sum of the other two sides.
		

Crossrefs

Cf. A052382.

Programs

  • Java
    public class A343760 {
       public static void main(String[] args) {
          for (long n = 1; n < 1000; n++) {
             if (is(n)) {
                System.out.print(n + ", ");
             }
          }
       }
       public static boolean is(long n) {
          String s = String.valueOf(n);
          if (n < 0 || s.contains("0")) {
             return false;
          }
          int perimeter = 0;
          char[] sides = s.toCharArray();
          for (int i = 0; i < sides.length; i++) {
             sides[i] -= '0';
             perimeter += sides[i];
          }
          for (int side : sides) {
             if (perimeter <= 2 * side) {
                return false;
             }
          }
          return true;
       }
    }
  • Mathematica
    Select[Range[111, 344], AllTrue[TakeDrop[#, 1] & /@ Permutations@ IntegerDigits[#], First[#1] < Total[#2] & @@ # &] &] (* Michael De Vlieger, May 01 2021 *)

A232879 The y-axis intercept of the line y = n*x + b tangent to the curve y = prime(k), k = 1, 2, 3, ....

Original entry on oeis.org

1, -1, -5, -13, -37, -83, -194, -469, -1111, -2743, -6698, -16379, -40543, -101251, -254053, -640483, -1622840, -4133371, -10578367, -27130829, -69814219
Offset: 1

Author

John R Phelan, Dec 01 2013

Keywords

Comments

This sequence contains the y intercepts for lines with integer slopes, such that all primes fall at or above the line. Verified for primes less than 2*10^9.
The first 15 tangent lines intercept prime(k) at the following primes: 2, 3, 5, 7, 13, 19, 23, 31, 43, 47, 113, 283, 1129, 2803, 7043, 24137, 59753, 59797, 155893, 445033, 1195247, 3278837.

Examples

			The 2nd tangent line, a(2)+2*k tangent line intercepts p(k) at 3,5,7.
a(n)+n*k = ...
a(2)+2*2 = -1+2*2 = 3 = p(2).
a(2)+2*3 = -1+2*3 = 5 = p(3).
a(2)+2*4 = -1+2*4 = 7 = p(4).
But other primes fall above the 2nd tangent line.
a(2)+2*1 = -1+2*1 = 1 < 2=p(1).
a(2)+2*5 = -1+2*5 = 9 < 11=p(5).
a(2)+2*6 = -1+2*6 = 11 < 13=p(6).
For the 11th tangent line...
a(11)+11*6041 = -6698+6041*11 = 59753 = p(6041).
a(11)+11*6045 = -6698+6045*11 = 59797 = p(6045).
But other primes fall above the 11th tangent line...
a(11)+11*6040 = -6698+6040*11 = 59742 < 59747 = p(6040)
a(11)+11*6042 = -6698+6042*11 = 59764 < 59771 = p(6042)
a(11)+11*6043 = -6698+6043*11 = 59765 < 59779 = p(6043)
a(11)+11*6044 = -6698+6044*11 = 59776 < 59791 = p(6044)
a(11)+11*6046 = -6698+6046*11 = 59798 < 59809 = p(6046)
		

Programs

  • Java
    public class Itp {private static long LIMIT = 10000000; private static long[] a = new long[100]; private static long[] p = new long[100]; public static void main(String[] args) {for (int n = 1; n < a.length; n++) {a[n] = Integer.MAX_VALUE;} long k = 1; for (int i = 2; i < LIMIT; i++) {if (isPrime(i)) {for (int n = 1; n < a.length; n++) {long l = i - n * k; if (l < a[n]) {a[n] = l; p[n] = i;}} k++;}} for (int n = 1; p[n] < LIMIT / 2; n++) {System.out.print(a[n] + ",");} System.out.println("");} private static boolean isPrime(int i) {if (i < 2) {return false;} int m = (int) Math.sqrt(i); for (int j = 2; j <= m; j++) {if (i % j == 0) {return false;}} return true;}}
  • Mathematica
    nn = 10^6; pt = Table[Prime[k], {k, nn}]; Table[r = n*Range[nn] - pt;
    mx = Max[r]; Print[{-mx, Flatten[Prime[Position[r, mx]]]}]; -mx, {n, 16}] (* T. D. Noe, Dec 04 2013 *)

Formula

n*k + a(n) <= prime(k), where n is the slope, and a(n) is the y intercept.

Extensions

a(16)-a(21) from T. D. Noe, Dec 04 2013

A232668 Natural numbers that are not (primes, 11-smooth, perfect powers or base-10 palindromes).

Original entry on oeis.org

26, 34, 38, 39, 46, 51, 52, 57, 58, 62, 65, 68, 69, 74, 76, 78, 82, 85, 86, 87, 91, 92, 93, 94, 95, 102, 104, 106, 114, 115, 116, 117, 118, 119, 122, 123, 124, 129, 130, 133, 134, 136, 138, 142, 143, 145, 146, 148, 152, 153, 155, 156, 158, 159, 164
Offset: 1

Author

John R Phelan, Nov 27 2013

Keywords

Comments

The intention was to generate a sequence of uninteresting numbers. - John R Phelan, Dec 01 2014

Examples

			16 is not in the sequence since it's a perfect power, 2^4.
19 is not in the sequence since it's prime.
18 is not in the sequence since it's 2*3*3, so it's 11-smooth.
22 is not in the sequence since it's a base 10 palindrome.
26 is in the sequence since it's 2*13, so it's not prime, not 11-smooth, not a base-10 palindrome, and not a perfect power.
		

Crossrefs

This sequence is A000027 \ A000040 \ A051038 \ A002113 \ A001597.

Programs

  • Java
    public class Nnn {public static void main(String[] args) {String str = ""; for (int i = 0; i < 1000000 && str.length() < 250; i++) {if (isPrime(i) || isSmooth(11,i) || isPerfectPower(i) || isPalindrome(i)) {} else {str += i + ", ";}} System.out.println(str);} static boolean isPalindrome(int i) {return ((i+"").equals(new StringBuilder(i+"").reverse().toString()));} static boolean isSmooth(int s, int n) {if (n<2) return true; for (int i=2;i<=s;i++) {while (n%i==0) n=n/i;} return n==1;} static boolean isPerfectPower(int n) {for (int i=2;i<=Math.sqrt(n);i++) {int j=i*i; while (j
    				

Formula

A \ B represents set "subtraction", all the elements in A that are not in B.
In other words, start with the Natural numbers (A000027).
Remove the prime numbers (A000040).
Remove the 11-smooth numbers, numbers whose prime divisors are all <= 11 (A051038).
Remove the base-10 palindromes (A002113).
Remove the perfect powers, m^k where m > 0 and k >= 2 (A001597).
And what's left is this sequence.
a(n) ~ n; in particular, a(n) = n + n/log n + o(n/log n). - Charles R Greathouse IV, Nov 27 2013

A232424 Floor of the half derivative of x^2 at n.

Original entry on oeis.org

0, 1, 4, 7, 12, 16, 22, 27, 34, 40, 47, 54, 62, 70, 78, 87, 96, 105, 114, 124, 134, 144, 155, 165, 176, 188, 199, 211, 222, 234, 247, 259, 272, 285, 298, 311, 324, 338, 352, 366, 380, 394, 409, 424, 439, 454, 469, 484, 500, 516, 531, 547, 564, 580, 597
Offset: 0

Author

John R Phelan, Nov 23 2013

Keywords

Examples

			a(4) = floor(8*4^(3/2)/(3*sqrt(Pi))) = floor(12.03604...) = 12.
		

Crossrefs

Programs

  • Java
    public class Hdx2 {public static void main(String[] args) {String str = ""; for (int n = 0; str.length() < 250; n++) {long f = (long) Math.floor(8 * Math.pow(n, 1.5) / (3 * Math.sqrt(Math.PI)));str += f + ", ";} System.out.println(str);} }
    
  • PARI
    a(n)=2*n^(3/2)\gamma(5/2) \\ Charles R Greathouse IV, Nov 23 2013

Formula

a(n) = floor(8*n^(3/2)/(3*sqrt(Pi))).
The d-th derivative of x^p is p!*x^(p-d)/(p-d)!, as long as (p-d) is not a negative integer.
For p = 2, d = 1/2 2!x^(3/2)/(3/2)! = 2x^(3/2)/((3/2)*(1/2)!) = 2x^(3/2)/((3/2)*sqrt(Pi)/2) = 8x^(3/2)/(3*sqrt(Pi)).
Note that 1.5! = Gamma(5/2).

A232241 Composites where the greatest prime factor is the sum of the other prime powers.

Original entry on oeis.org

4, 9, 25, 30, 49, 70, 84, 121, 169, 198, 264, 286, 289, 308, 361, 468, 520, 529, 646, 841, 884, 912, 961, 1224, 1369, 1566, 1672, 1681, 1748, 1798, 1849, 2209, 2576, 2809, 2900, 3135, 3348, 3481, 3526, 3570, 3721, 4489, 5041, 5329, 5704, 5920, 6032
Offset: 1

Author

John R Phelan, Nov 20 2013

Keywords

Comments

This is the sequence of positive integers that can be expressed as the product of prime powers, multiplied by the sum of the same prime powers. And the sum of the prime powers is also the greatest prime factor of the composite number.
I.e., there is a solution for n=(p1^i1*p2^i2*p3^i3...)*(p1^i1+p2^i2+pi3^i3...); where p1, p2, p3, etc. are distinct primes; and i1, i2, i3, etc. are the corresponding positive exponents.
The additional constraint is that the sum of the prime powers must also be the greatest prime factor (gpf) of n.
This sequence also contains the square of every prime number.

Examples

			9 is in the sequence since prod(3^1)*sum(3^1)=(3^1)*(3^1)=3*3=9, and the gpf, 3 is prime.
1224 is in the sequence since (2^3*3^2)*(2^3+3^2)=(8*9)*(8+9)=72*17=1224, and the gpf, 17 is prime.
6032 is in the sequence since (2^4*13^1)*(2^4+13^1)=(16*13)*(16+13)=208*29=6032, and the gpf, 29 is prime.
		

Crossrefs

Variant of A163836.

Programs

  • Java
    public class Psfi {public static void main(String[] args) {String sequence = ""; for (int n = 2; sequence.length() < 250; n++) {int q = n; int s = 0; for (int d = 2; d <= Math.sqrt(q); d++) {int i = 0; while (q > d && q % d == 0) {i++; q = q / d;} if (i > 0) {s += Math.pow(d, i);} } if (s == q) {sequence += n + ", ";} } System.out.println(sequence);} }
    
  • Mathematica
    seqQ[n_] := Module[{f = FactorInteger[n]}, If[Length[f] == 1, f[[1, 2]] == 2, f[[-1, 2]] == 1 && f[[-1, 1]] == Plus @@ Power @@@ Most[f]]]; Select[Range[6000], seqQ] (* Amiram Eldar, Apr 28 2020 *)
  • PARI
    isok(n) = {if (n>1, my(fa = factor(n), gpf = fa[#fa~, 1], fb = factor(n/gpf)); gpf == sum(i=1, #fb~, fb[i, 1]^fb[i, 2])); } \\ Michel Marcus, Nov 21 2013; Apr 28 2020

A231979 Numbers n such that for every digit d in n, 2*n + 6*d - 3 is prime.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 10, 13, 17, 19, 22, 29, 32, 34, 37, 43, 44, 50, 52, 55, 65, 67, 70, 77, 83, 89, 112, 113, 115, 118, 124, 127, 133, 145, 152, 155, 167, 172, 182, 188, 199, 200, 215, 229, 274, 277, 295, 302, 308, 322, 362, 379, 400, 418, 433, 488, 494, 499
Offset: 1

Author

John R Phelan, Nov 16 2013

Keywords

Comments

The coefficients 2,6,-3 yield more hits between 1 and 1000000 than 2,2,1 or 1,1,1.

Examples

			124 is in the sequence since
  2*124+6*1-3=251 which is prime,
  2*124+6*2-3=257 which is prime,
  2*124+6*4-3=269 which is prime.
241 is NOT in the sequence since
  2*241+6*2-3=491 which is prime,
  2*241+6*4-3=503 which is prime,
  but 2*241+6*1-3=485 which is not prime.
		

Programs

  • Java
    public class Ndp {
    // 2n+6d-3 is prime for all digits d in n
    private static final int MAX = 1000000;
    public static void main(String[] args) {
      String sequence = "";
      loop: for (int n = 1; sequence.length() < 250 && n < MAX; n++) {
       for (int i = n; i > 0; i /= 10) {
        int d = i % 10;
        if (!isPrime(2 * n + 6 * d - 3)) {
         continue loop;
        }
       }
       sequence += n + ",";
      }
      System.out.println(sequence);
    }
    private static boolean isPrime(long n) {
      for (long i = 2; i <= Math.sqrt(n); i++) {
       if (n < 2 || n % i == 0) {
        return false;
       }
      }
      return true;
    }
    }
  • Mathematica
    fQ[n_] := Module[{d = IntegerDigits[n]}, And @@ PrimeQ[2*n + 6*d - 3]]; Select[Range[1000], fQ] (* T. D. Noe, Nov 19 2013 *)

A231603 Floor of the arithmetic-geometric mean of n+n and n*n.

Original entry on oeis.org

0, 1, 4, 7, 11, 16, 22, 28, 35, 43, 52, 61, 70, 81, 92, 103, 115, 128, 141, 155, 170, 185, 200, 216, 233, 250, 268, 286, 305, 325, 344, 365, 386, 408, 430, 452, 475, 499, 523, 548, 573, 598, 625, 651, 678, 706, 734, 763, 792, 822, 852, 883, 914, 945, 978, 1010, 1043, 1077, 1111, 1145, 1180, 1216, 1252, 1288, 1325
Offset: 0

Author

John R Phelan, Nov 11 2013

Keywords

Comments

Arithmetic-geometric mean of n+n and n*n.
AGM of the sum and product of n and n.
a(n) = agm(A005843(n), A000290(n)).

Examples

			a(2) = floor(agm(2+2, 2*2)) = floor(agm(4, 4)) = 4.
a(5) = floor(agm(10.0, 25.0)) = floor(agm(17.5, 15.811388)) = floor(agm(16.655695, 16.634281)) = floor(agm(16.644987, 16.644983)) = floor(16.644987) = 16.
		

Crossrefs

Programs

  • Java
    public class Agmnxn {
        private static final double TOLERANCE = Math.pow(10, -4);
        private static final long LENGTH = 250;
        public static void main(String[] args) {
           String series="";
           long n=0;
           while (series.length()
    				
  • Mathematica
    Table[Floor[ArithmeticGeometricMean[2n,n^2]],{n,0,70}] (* Harvey P. Dale, Aug 03 2014 *)

Formula

a(n) = floor(agm(n+n,n*n)).