%I #71 May 18 2022 13:12:16
%S 13,31,1546463
%N Balancing Wieferich primes: primes p that divide their Pell quotients, where the Pell quotient of p is A000129(p - (2/p))/p and (2/p) is a Jacobi symbol.
%C Williams 1982 (p. 86), notes that p = 13, 31 and 1546463 are the only primes less than 10^8 for which the Pell quotient vanishes mod p. Elsenhans and Jahnel, "The Fibonacci sequence modulo p^2," p. 5, report in effect that there are no more such primes p < 10^9.
%C Williams 1991 (p. 440), and Sun 1995 pt. 3, Theorem 3.3, together prove a set of formulas connecting the Pell quotient with the Fermat quotient (base 2) (A007663) and harmonic numbers like H(floor(p/8)) (see example in the Formula section below). As is well known, the vanishing of the Fermat quotient (base 2) is a necessary condition for the failure of the first case of Fermat's Last Theorem (see discussion under A001220); and in light of a corresponding result of Dilcher and Skula concerning this type of harmonic number, the vanishing of the Pell quotient mod p is also a necessary condition for the failure of the first case of Fermat's Last Theorem.
%C There are no more terms up to 10^10.
%C Using the PARI script by _Charles R Greathouse IV_, I have extended the search from 10^10 to 10^12 without finding a further solution. - _John Blythe Dobson_, Mar 30 2015
%C Also primes p such that p^2 divides A001109((p - (2/p))/2). - _Jianing Song_, Oct 08 2018
%C From _Felix Fröhlich_, May 18 2019: (Start)
%C The term "balancing Wieferich prime" comes from Rout, 2016.
%C Primes p that satisfy the congruence B_{p-(8/p)} == 0 (mod p^2), where B_i denotes the i-th balancing number A001109(i) and (a/b) denotes the Jacobi symbol (cf. Rout, 2016, (1.6)).
%C Primes p such that the period of the balancing sequence (A001109) modulo p is equal to the period of the balancing sequence modulo p^2 (cf. Panda, Rout, 2014, p. 275).
%C Under the abc conjecture for the number field Q(sqrt(2)) there exist at least (log(x)/log(log(x)))*(log(log(log(x))))^m balancing non-Wieferich primes <= x such that p == 1 (mod k) for any integers k > 2, m > 0 (cf. Dutta, Patel, Ray, 2019). This is an improvement of an earlier result stating there are at least log(x)/log(log(x)) balancing non-Wieferich primes p == 1 (mod k) less than x (cf. Theorem 3.2 in Rout 2016). (End)
%H Zakariae Bouazzaoui, <a href="https://www.fq.math.ca/Papers1/58-5/bouazzaoui.pdf">On Periods of Fibonacci Sequences and Real Quadratic p-rational Fields</a>, Fibonacci Quart. 58 (2020), no. 5, 103-110. See p. 7.
%H Karl Dilcher and Ladislav Skula, <a href="https://doi.org/10.1090/S0025-5718-1995-1248969-6">A new criterion for the first case of Fermat's Last Theorem</a>, Mathematics of Computation, 64 (1995), 363-392.
%H Utkal Keshari Dutta, Bijan Kumar Patel and Prasanta Kumar Ray, <a href="https://doi.org/10.24193/mathcluj.2018.1.05">A brief remark on balancing-Wieferich primes</a>, Mathematica, Vol. 60 (83), No. 1 (2018), 48-53 [Subscription required].
%H Utkal Keshari Dutta, Bijan Kumar Patel and Prasanta Kumar Ray, <a href="https://www.ias.ac.in/article/fulltext/pmsc/129/02/0021">Balancing non-Wieferich primes in arithmetic progressions</a>, Proceedings - Mathematical Sciences, Vol. 129, No. 2 (2019), Article 21, DOI:<a href="https://doi.org/10.1007/s12044-018-0459-3">10.1007/s12044-018-0459-3</a>.
%H Andreas-Stephan Elsenhans and Jörg Jahnel, <a href="https://arxiv.org/abs/1006.0824">The Fibonacci sequence modulo p^2 -- An investigation by computer for p < 10^14</a>, arXiv 1006.0824 [math.NT], 2010.
%H Georges Gras, <a href="https://arxiv.org/abs/1212.3588">On the structure of the Galois group of the Abelian closure of a number field</a>, arXiv 1212.3588 [math.NT], 2013.
%H Hao Pan, <a href="https://arxiv.org/abs/0905.0941">Lehmer's type congruences for lacunary harmonic sums</a>, arXiv 0905.0941 [math.NT], 2009.
%H G. K. Panda and S. S. Rout, <a href="https://doi.org/10.1007/s10474-014-0427-z">Periodicity of Balancing Numbers</a>, Acta Mathematica Hungarica 143 (2014), 274-286. Also on <a href="https://www.researchgate.net/publication/237278890">ResearchGate</a>.
%H Sudhansu Sekhar Rout, <a href="https://doi.org/10.3792/pjaa.92.112">Balancing non-Wieferich primes in arithmetic progression and abc conjecture</a>, Proc. Japan Acad. Ser. A Math. Sci., Volume 92, Number 9 (2016), 112-116.
%H Zhi-Hong Sun, <a href="http://www.hytc.cn/xsjl/szh/coms3.pdf">Combinatorial sum ... and its applications in Number Theory, III</a> (English version), originally published in Chinese in Journal of Nanjing University Mathematical Biquarterly, 12 (1995), 90-102.
%H Zhi-Hong Sun, <a href="http://www.fq.math.ca/Scanned/40-4/sun.pdf">Five congruences for primes</a>, Fibonacci Quarterly, 40 (2002), 345-351.
%H H. C. Williams, <a href="https://doi.org/10.1016/0898-1221(82)90026-8">The influence of computers in the development of number theory</a>, Computers & Mathematics with Applications, 8 (1982), 75-93.
%H H. C. Williams, <a href="https://doi.org/10.1016/0012-365X(91)90298-G">Some formulas concerning the fundamental unit of a real quadratic field,</a> Discrete Mathematics, 92 (1991), 431--440.
%F The condition for p to be a member of this sequence is A000129(p-e)/p == F(p-e, 2)/p == 0 (mod p), where F(p-e, 2) is the p-e'th Fibonacci polynomial evaluated at the argument 2, and e = (2/p) is a Jacobi Symbol.
%F Let PellQuotient(p) = A000129(p-e)/p, q_2 = (2^(p-1) - 1)/p = A007663(p) be the corresponding Fermat quotient of base 2, H(floor(p/8)) be a harmonic number, and e = (2/p) be a Jacobi Symbol. Then a result of Williams (1991), as refined by Sun (1995), shows that 2*PellQuotient(p) == -4*q_2 - H(floor(p/8)) (mod p).
%e PellQuotient(13) = 6214 = 13*478; PellQuotient(31) = 3470274850 = 31*111944350.
%t Select[Prime[Range[1000]], Mod[Fibonacci[# - JacobiSymbol[2, #], 2]/#, #] == 0 &]
%o (PARI) is(n)=isprime(n) && (Mod([2,1;1,0],n^2)^(n-kronecker(2,n)))[2,1]==0 \\ _Charles R Greathouse IV_, Mar 04 2014
%Y Cf. A000129, A001109.
%K nonn,hard,more,bref
%O 1,1
%A _John Blythe Dobson_, Mar 04 2014
%E Name amended by _Felix Fröhlich_, May 26 2019