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.

Previous Showing 11-20 of 25 results. Next

A166681 Primes p which have at least one prime anagram larger than p.

Original entry on oeis.org

13, 17, 37, 79, 107, 113, 127, 131, 137, 139, 149, 157, 163, 167, 173, 179, 181, 191, 197, 199, 239, 241, 251, 277, 281, 283, 313, 337, 347, 349, 359, 367, 373, 379, 389, 397, 419, 457, 461, 463, 467, 479, 491, 563, 569, 571, 577, 587, 593, 613
Offset: 1

Views

Author

Pierre CAMI, Oct 18 2009

Keywords

Comments

Primes like 113, 137, 149, 157 etc have more than one such larger anagram, but are only listed once.

Examples

			13 is the first with 31 as prime anagram.
17 is the second with 71 as prime anagram.
31 has one anagram 13 but this is not >31 so 31 is not in the sequence.
		

Crossrefs

Programs

  • Maple
    filter:= proc(p) local L,Lp,q,i;
      if not isprime(p) then return false fi;
      L:= convert(p,base,10);
      for Lp in combinat:-permute(L) do
        q:= add(Lp[i]*10^(i-1),i=1..nops(L));
        if q > p and isprime(q) then return true fi
      od;
    false
    end proc:
    select(filter, [seq(i,i=13..1000,2)]); # Robert Israel, Jan 18 2023
  • Mathematica
    paQ[n_]:=Length[Select[FromDigits/@Permutations[IntegerDigits[n]],#>n && PrimeQ[#]&]]>0; Select[Prime[Range[200]],paQ] (* Harvey P. Dale, Sep 23 2013 *)
  • Python
    from itertools import islice
    from sympy.utilities.iterables import multiset_permutations
    from sympy import isprime, nextprime
    def A166681_gen(): # generator of terms
        p = 13
        while True:
            for q in multiset_permutations(str(p)):
                if (r:=int(''.join(q)))>p and isprime(r):
                    yield p
                    break
            p = nextprime(p)
    A166681_list = list(islice(A166681_gen(),20)) # Chai Wah Wu, Jan 17 2023

Extensions

Definition clarified, sequence extended. - R. J. Mathar, Oct 12 2012

A227692 Smaller of two consecutive squares which are anagrams (permutations) of each other.

Original entry on oeis.org

169, 24649, 833569, 20367169, 214534609, 368678401, 372142681, 392554969, 407676481, 771617284, 1013021584, 1212780625, 1404075841, 1567051396, 1623848209, 2538748996, 2866103296, 2898960964, 3015437569, 3967236196, 4098688441, 4937451289, 5854239169
Offset: 1

Views

Author

Michel Lagneau, Aug 12 2013

Keywords

Comments

Given the n-th square, it is occasionally possible to form the (n+1)-th square using the same digits in a different order.
"Anagram" means that both squares must not only use the same digits but must use each digit the same number of times.

Examples

			169 and 196 are two successive squares.
		

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 1 to 80000 do:p1:=n^2:p2:= (n+1)^2:pp1:=convert(p1,base,10): pp2:=convert(p2,base,10):n1:=sort(pp1):n2:=sort(pp2): if n1=n2 then printf(`%d, `,p1):else fi:od:
  • Mathematica
    lst = {}; k = 1; s = t = 0; ss = {0}; While[k < 155001, s = t; t += k; st = Sort@IntegerDigits@ t; If[ss == st, AppendTo[lst, s]]; ss = st; k += 2]; lst (* Robert G. Wilson v, Oct 24 2014 *)
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        ip, sp, hp = 0, 0, "0"
        for i in count(1):
            s = i*i
            h = "".join(sorted(str(s)))
            if h == hp: yield sp
            ip, sp, hp = i, s, h
    print(list(islice(agen(), 23))) # Michael S. Branicky, Feb 18 2024

A339080 Smaller members of binary Ormiston prime pairs: two consecutive primes whose binary representations are anagrams of each other.

Original entry on oeis.org

11, 23, 37, 59, 83, 103, 107, 131, 139, 151, 167, 173, 179, 199, 227, 229, 263, 277, 347, 409, 419, 439, 487, 491, 503, 557, 563, 613, 647, 653, 659, 683, 719, 727, 757, 811, 823, 827, 839, 853, 911, 941, 947, 953, 967, 997, 1019, 1063, 1091, 1093, 1123, 1163
Offset: 1

Views

Author

Amiram Eldar, Nov 22 2020

Keywords

Comments

Equivalently, the smaller of two consecutive primes with the same length of binary representation (A070939) and the same binary weight (A000120).

Examples

			11 is a term since 11 and 13 are consecutive primes whose binary representations, 1011 and 1101, are anagrams of each other.
		

Crossrefs

Cf. A000120, A069567 (decimal analog), A070939, A072274.

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[200]], 2, 1], Sort[IntegerDigits[First[#],2]] == Sort[IntegerDigits[Last[#],2]]&]][[1]] (* after Harvey P. Dale at A069567 *)
  • Python
    from sympy import nextprime
    from itertools import islice
    def hash(n): return "".join(sorted(bin(n)[2:]))
    def agen(start=2): # generator of terms
        p = nextprime(start-1); q=nextprime(p)
        hp, hq = list(map(hash, [p, q]))
        while True:
            if hp == hq: yield p
            p, q = q, nextprime(q)
            hp, hq = hq, hash(q)
    print(list(islice(agen(), 52))) # Michael S. Branicky, Feb 19 2024

A353346 Numbers k such that the elements of the continued fraction of the abundancy index of k and k+1 are anagrams of each other.

Original entry on oeis.org

2084564, 11784194, 13667268, 52820326, 68397891, 101183694, 128247668, 135641787, 137681487, 170542955, 266319572, 284966486, 384109196, 386860419, 482419526, 483785771, 546800667, 579468939, 606809224, 622241109, 703636544, 737703005, 829965829, 830993564, 834224684, 973986250
Offset: 1

Views

Author

Amiram Eldar, Apr 15 2022

Keywords

Examples

			2084564 is a term since the sequences of elements of the continued fractions of sigma(2084564)/2084564 = 941472/521141 and sigma(2084565)/2084565 = 1270656/694855, {1, 1, 4, 5, 1, 8, 1, 5, 2, 4, 1, 7, 3} and {1, 1, 4, 1, 5, 8, 1, 2, 4, 7, 3, 1, 5} respectively, are anagrams of each other.
		

Crossrefs

Programs

  • Mathematica
    ab[n_] := Sort[ContinuedFraction[DivisorSigma[-1, n]]]; seq[max_] := Module[{s = {}, n = 2, c = 0, ab1 = ab[1], ab2}, While[n < max, ab2 = ab[n]; If[ab1 == ab2, AppendTo[s, n - 1]]; ab1 = ab2; n++]; s]; seq[1.4*10^7]

A163679 Smaller prime p in Ormiston pairs (p, q) with q - p = 36.

Original entry on oeis.org

98737, 116293, 187237, 240437, 276781, 343337, 357437, 447137, 454637, 456293, 465337, 508037, 542837, 565937, 586237, 623071, 802037, 817237, 820837, 836071, 837737, 839837, 843137, 850637, 884537, 897781, 903037, 913337, 1032071
Offset: 1

Views

Author

Klaus Brockhaus, Aug 03 2009

Keywords

Comments

An Ormiston pair (or rearrangement prime pair) is a pair of consecutive primes that use the same digits in a different order.

Examples

			(187237, 187273) is an Ormiston pair with gap 36, so 187237 is in the sequence.
		

Crossrefs

Subsequence of A069567.

Programs

  • Magma
    [ p: p in PrimesUpTo(1050000) | q-p eq 36 and a eq b where a is Sort(Intseq(p)) where b is Sort(Intseq(q)) where q is NextPrime(p) ];
  • Mathematica
    Transpose[Select[Select[Partition[Prime[Range[8000]], 2, 1], Last[#] - First[#] == 36 &], Sort[IntegerDigits[First[#]]] == Sort[IntegerDigits[Last[#]]] &]][[1]] (* G. C. Greubel, Aug 02 2017 *)

Extensions

Keyword base added by Klaus Brockhaus, Sep 18 2009

A163680 Smaller prime p in Ormiston pairs (p, q) with q - p = 54.

Original entry on oeis.org

35617, 40639, 359783, 502339, 552917, 580417, 668417, 719839, 807017, 824339, 833117, 861239, 909917, 961339, 987739, 1078417, 1145539, 1168639, 1185017, 1196539, 1220839, 1313239, 1479617, 1497439, 1710439, 1710539, 1732139
Offset: 1

Views

Author

Klaus Brockhaus, Aug 03 2009

Keywords

Comments

An Ormiston pair (or rearrangement prime pair) is a pair of consecutive primes that use the same digits in a different order.

Examples

			(359783, 359837) is an Ormiston pair with gap 54, so 359783 is in the sequence.
		

Crossrefs

Subsequence of A069567.

Programs

  • Magma
    [ p: p in PrimesUpTo(1750000) | q-p eq 54 and a eq b where a is Sort(Intseq(p)) where b is Sort(Intseq(q)) where q is NextPrime(p) ];
  • Mathematica
    op54Q[{a_,b_}]:=Sort[IntegerDigits[a]]==Sort[IntegerDigits[b]] && b-a==54; Transpose[Select[Partition[Prime[Range[150000]],2,1],op54Q]][[1]] (* Harvey P. Dale, Jun 16 2014 *)

Extensions

Keyword base added by Klaus Brockhaus, Sep 18 2009

A163682 Smaller prime p in Ormiston pairs (p, q) with q - p = 90.

Original entry on oeis.org

2030789, 2542237, 3863017, 4508341, 7001123, 7583341, 8482459, 8547677, 8916239, 9194677, 9470017, 11117123, 11755673, 11999563, 13691563, 13898237, 15906127, 16047673, 16272343, 16299013, 16829563, 17437457, 17604347
Offset: 1

Views

Author

Klaus Brockhaus, Aug 03 2009

Keywords

Comments

An Ormiston pair (or rearrangement prime pair) is a pair of consecutive primes that use the same digits in a different order.

Examples

			(3863017, 3863107) is an Ormiston pair with gap 90, so 3863017 is in the sequence.
		

Crossrefs

Subsequence of A069567.

Programs

  • Magma
    [ p: p in PrimesUpTo(17700000) | q-p eq 90 and a eq b where a is Sort(Intseq(p)) where b is Sort(Intseq(q)) where q is NextPrime(p) ];
  • Mathematica
    Transpose[Select[Select[Partition[Prime[Range[70000]], 2, 1], Last[#] - First[#] == 90 &], Sort[IntegerDigits[First[#]]] == Sort[IntegerDigits[Last[#]]] &]][[1]] (* G. C. Greubel, Aug 02 2017 *)

Extensions

Keyword base added by Klaus Brockhaus, Sep 18 2009

A247305 The smaller of two consecutive triangular numbers which are permutations of each other.

Original entry on oeis.org

404550, 2653056, 3643650, 5633046, 6413571, 10122750, 10656036, 13762881, 19841850, 26634051, 32800950, 47848653, 56769840, 71634465, 89184690, 103672800, 137108520, 317053971, 345069585, 392714325, 408508236, 440762895, 508948560, 598735710, 718830486, 825215625
Offset: 1

Views

Author

K. D. Bajpai, Sep 11 2014

Keywords

Comments

All the terms in sequence are congruent to 0 mod 9.
It appears that the digital root (repeated sum of digits) of the index +1 of a(n) in A000217 is 9 for each n>=1.o 0 mod 9. For example, 404550 = A000217(899), and 899+1 = 900 has digital root 9.

Examples

			a(1) = 404550 is in the sequence because {404550 and 405450} are a pair of consecutive triangular numbers having exactly the same digits.
a(2) = 2653056 is in the sequence because {2653056 and 2655360} are two consecutive triangular numbers having exactly the same digits.
		

Crossrefs

Programs

  • Mathematica
    A247305 = {}; a = {1}; b = {2}; Do[t1 = n*(n + 1)/2; t2 = (n - 1)*(n - 1 + 1)/2; b = Sort[IntegerDigits[t1]]; If[a == b, AppendTo[A247305, t2]]; a = b, {n, 2, 7*10^4}]; A247305
  • PARI
    lista(nn) = {for (n=1, nn, dt = vecsort(digits(t=n*(n+1)/2)); dnt = vecsort(digits((n+1)*(n+2)/2)); if (dt == dnt, print1(t, ", ")););} \\ Michel Marcus, Sep 13 2014

A353345 Numbers k such that the elements of the continued fractions of the harmonic means of the divisors of k and k+1 are anagrams of each other.

Original entry on oeis.org

688126, 29900656, 35217656, 71624168, 154979487, 527560886, 871173148, 1370592266, 2461226804, 3232529461, 3232684430, 3431178214, 3471121856, 3486231973, 3527029430, 5732671200, 6258062402, 8784477355, 9334188311, 12670993089, 12707869077, 15120804392, 16317131894
Offset: 1

Views

Author

Amiram Eldar, Apr 15 2022

Keywords

Examples

			688126 is a term since sequences of elements of the continued fractions of the harmonic means of the divisors of 688126 and 688127, 688126/70281 and 688127/77304, are {9, 1, 3, 1, 3, 1, 2, 9, 1, 1, 6, 8} and {8, 1, 9, 6, 3, 1, 2, 1, 3, 1, 1, 9} respectively, and they are anagrams of each other.
		

Crossrefs

Programs

  • Mathematica
    h[n_] := Sort[ContinuedFraction[DivisorSigma[0, n]/DivisorSigma[-1, n]]]; seq[max_] := Module[{s = {}, n = 2, c = 0, h1 = h[1], h2}, While[n < max, h2 = h[n]; If[h1 == h2, AppendTo[s, n - 1]]; h1 = h2; n++]; s]; seq[4*10^7]

A353347 Numbers k such that the elements of the continued fraction of phi(k)/k and phi(k+1)/(k+1) are anagrams of each other.

Original entry on oeis.org

1287, 96074, 5600160, 18486908, 41746312, 78700687, 211818591, 346666215, 535185325, 600248114, 617086359, 682116194, 972901517, 1326113558, 1397946770, 1404159416, 1785588903, 2090593128, 2286664100, 2349999964, 2396173329, 3154287487, 4029358361, 5401346573
Offset: 1

Views

Author

Amiram Eldar, Apr 15 2022

Keywords

Examples

			1287 is a term since the sequences of elements of the continued fractions of phi(1287)/1287 = 80/143 and phi(1288)/1288 = 66/161, {0, 1, 1, 3, 1, 2, 2, 2} and {0, 2, 2, 3, 1, 1, 1, 2} respectively, are anagrams of each other.
		

Crossrefs

Programs

  • Mathematica
    r[n_] := Sort[ContinuedFraction[EulerPhi[n]/n]]; seq[max_] := Module[{s = {}, n = 2, c = 0, r1 = r[1], r2}, While[n < max, r2 = r[n]; If[r1 == r2, AppendTo[s, n - 1]]; r1 = r2; n++]; s]; seq[6*10^6]
Previous Showing 11-20 of 25 results. Next